Skip to content

Commit

Permalink
Make PartialOrd impl canonical for Empirical
Browse files Browse the repository at this point in the history
  • Loading branch information
FreezyLemon committed Apr 28, 2024
1 parent 9e63ee4 commit 52a104c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/distribution/empirical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ impl<T: PartialEq> Eq for NonNAN<T> {}

impl<T: PartialOrd> PartialOrd for NonNAN<T> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.0.partial_cmp(&other.0)
Some(self.cmp(other))
}
}

impl<T: PartialOrd> Ord for NonNAN<T> {
fn cmp(&self, other: &Self) -> Ordering {
self.partial_cmp(other).unwrap()
self.0.partial_cmp(&other.0).unwrap()
}
}

Expand Down

0 comments on commit 52a104c

Please sign in to comment.