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.
This commit is contained in:
Matthew Leach
2025-11-22 12:38:53 +00:00
parent 6c804ce2a7
commit 30eb4fc794

View File

@@ -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<core::cmp::Ordering> {
Some(self.when.cmp(&other.when).reverse())
@@ -93,6 +94,7 @@ impl Sub<Instant> for Instant {
}
}
#[allow(clippy::non_canonical_partial_ord_impl)]
impl PartialOrd for Instant {
fn partial_cmp(&self, other: &Self) -> Option<core::cmp::Ordering> {
self.ticks.partial_cmp(&other.ticks)