/* This file is part of jellything (https://codeberg.org/metamuffin/jellything) which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2025 metamuffin */ use std::ops::Deref; #[derive(PartialEq)] pub struct SortAnyway(pub T); impl Eq for SortAnyway { fn assert_receiver_is_total_eq(&self) {} } #[allow(clippy::non_canonical_partial_ord_impl)] impl PartialOrd for SortAnyway { fn partial_cmp(&self, other: &Self) -> Option { self.0.partial_cmp(&other.0) } } impl Ord for SortAnyway { fn cmp(&self, other: &Self) -> std::cmp::Ordering { self.partial_cmp(other).unwrap() } } impl Deref for SortAnyway { type Target = T; fn deref(&self) -> &Self::Target { &self.0 } }