From 5e01eb8ee7bec9b381c43762682ecf47e700d690 Mon Sep 17 00:00:00 2001 From: Rui Hu Date: Mon, 22 Jan 2024 22:41:21 -0800 Subject: [PATCH] fix partial order lint error (#53) --- 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)) } }