mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2026-05-19 14:21:02 -04:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user