diff options
| author | Sébastien Crozet <sebcrozet@dimforge.com> | 2024-01-27 16:49:53 +0100 |
|---|---|---|
| committer | Sébastien Crozet <sebastien@crozet.re> | 2024-01-27 17:13:08 +0100 |
| commit | da92e5c2837b27433286cf0dd9d887fd44dda254 (patch) | |
| tree | 00428ce290288f5c64e53dee13d88ffdde4df0ca /src/dynamics/ccd/toi_entry.rs | |
| parent | aef873f20e7a1ee66b9d4c066884fa794048587b (diff) | |
| download | rapier-da92e5c2837b27433286cf0dd9d887fd44dda254.tar.gz rapier-da92e5c2837b27433286cf0dd9d887fd44dda254.tar.bz2 rapier-da92e5c2837b27433286cf0dd9d887fd44dda254.zip | |
Fix clippy and enable clippy on CI
Diffstat (limited to 'src/dynamics/ccd/toi_entry.rs')
| -rw-r--r-- | src/dynamics/ccd/toi_entry.rs | 6 |
1 files changed, 4 insertions, 2 deletions
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<std::cmp::Ordering> { - (-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) } } |
