From da92e5c2837b27433286cf0dd9d887fd44dda254 Mon Sep 17 00:00:00 2001 From: Sébastien Crozet Date: Sat, 27 Jan 2024 16:49:53 +0100 Subject: Fix clippy and enable clippy on CI --- src/dynamics/ccd/toi_entry.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/dynamics/ccd/toi_entry.rs') diff --git a/src/dynamics/ccd/toi_entry.rs b/src/dynamics/ccd/toi_entry.rs index 6f5a47d..719f3c5 100644 --- a/src/dynamics/ccd/toi_entry.rs +++ b/src/dynamics/ccd/toi_entry.rs @@ -169,13 +169,15 @@ impl TOIEntry { impl PartialOrd for TOIEntry { fn partial_cmp(&self, other: &Self) -> Option { - (-self.toi).partial_cmp(&(-other.toi)) + Some(self.cmp(other)) } } impl Ord for TOIEntry { fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.partial_cmp(other).unwrap() + (-self.toi) + .partial_cmp(&(-other.toi)) + .unwrap_or(std::cmp::Ordering::Equal) } } -- cgit