use std::ops::Deref; #[derive(PartialEq, PartialOrd)] pub struct SortAnyway(pub T); impl Eq for SortAnyway { fn assert_receiver_is_total_eq(&self) {} } 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 } }