From edd88d31b6ed9e9d049a946fc0fbebc26fac0db7 Mon Sep 17 00:00:00 2001 From: Rui Hu Date: Mon, 22 Jan 2024 22:36:40 -0800 Subject: [PATCH] fix clippy errors --- src/heap_element.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/heap_element.rs b/src/heap_element.rs index d775fc9..527e33e 100644 --- a/src/heap_element.rs +++ b/src/heap_element.rs @@ -8,13 +8,13 @@ pub struct HeapElement { impl Ord for HeapElement { fn cmp(&self, other: &Self) -> Ordering { - self.partial_cmp(other).unwrap_or(Ordering::Equal) + self.distance.partial_cmp(&other.distance).unwrap_or(Ordering::Equal) } } impl PartialOrd for HeapElement { fn partial_cmp(&self, other: &Self) -> Option { - self.distance.partial_cmp(&other.distance) + Some(self.cmp(other)) } }