diff options
author | metamuffin <metamuffin@disroot.org> | 2024-06-10 15:28:36 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-10 15:28:36 +0200 |
commit | 05d11426a8e60fa060733eb8ae7843bc2ae9725c (patch) | |
tree | 57cfad9cedf1eb50de193f1657b42234745c044e /common/src/helpers.rs | |
parent | c0365c8c64f403fd9ee75c0db1a9ed6134633e8f (diff) | |
download | jellything-05d11426a8e60fa060733eb8ae7843bc2ae9725c.tar jellything-05d11426a8e60fa060733eb8ae7843bc2ae9725c.tar.bz2 jellything-05d11426a8e60fa060733eb8ae7843bc2ae9725c.tar.zst |
apply many clippy issue
Diffstat (limited to 'common/src/helpers.rs')
-rw-r--r-- | common/src/helpers.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/common/src/helpers.rs b/common/src/helpers.rs index 92595e0..54f5479 100644 --- a/common/src/helpers.rs +++ b/common/src/helpers.rs @@ -5,15 +5,21 @@ */ use std::ops::Deref; -#[derive(PartialEq, PartialOrd)] +#[derive(PartialEq)] pub struct SortAnyway<T>(pub T); impl<T: PartialEq> Eq for SortAnyway<T> { fn assert_receiver_is_total_eq(&self) {} } +#[allow(clippy::non_canonical_partial_ord_impl)] +impl<T: PartialOrd> PartialOrd for SortAnyway<T> { + fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> { + self.0.partial_cmp(&other.0) + } +} impl<T: PartialOrd> Ord for SortAnyway<T> { fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.partial_cmp(&other).unwrap() + self.partial_cmp(other).unwrap() } } |