Skip to content

Commit

Permalink
fix partial order lint error (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhooray authored Jan 23, 2024
1 parent 7f03078 commit 5e01eb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/heap_element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ pub struct HeapElement<A, T> {

impl<A: Float, T> Ord for HeapElement<A, T> {
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<A: Float, T> PartialOrd for HeapElement<A, T> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.distance.partial_cmp(&other.distance)
Some(self.cmp(other))
}
}

Expand Down

0 comments on commit 5e01eb8

Please sign in to comment.