From 30eb4fc7942b90afeb6ff3c623a26ca79a1f6710 Mon Sep 17 00:00:00 2001 From: Matthew Leach Date: Sat, 22 Nov 2025 12:38:53 +0000 Subject: [PATCH] timer: supress clippy warnings for PartialOrd impl Clippy is complaining about a non-canonical PartialOrd implementation for Instant. We do this so that the instant that is going to be fired next is always at the top of the Heap. --- src/drivers/timer/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/drivers/timer/mod.rs b/src/drivers/timer/mod.rs index 309c9a9..8ea2c07 100644 --- a/src/drivers/timer/mod.rs +++ b/src/drivers/timer/mod.rs @@ -50,6 +50,7 @@ impl PartialEq for WakeupEvent { impl Eq for WakeupEvent {} +#[allow(clippy::non_canonical_partial_ord_impl)] impl PartialOrd for WakeupEvent { fn partial_cmp(&self, other: &Self) -> Option { Some(self.when.cmp(&other.when).reverse()) @@ -93,6 +94,7 @@ impl Sub for Instant { } } +#[allow(clippy::non_canonical_partial_ord_impl)] impl PartialOrd for Instant { fn partial_cmp(&self, other: &Self) -> Option { self.ticks.partial_cmp(&other.ticks)