Skip to content

Commit

Permalink
Merge pull request #569 from jeremyandrews/clippy
Browse files Browse the repository at this point in the history
fix non_canonical_partial_ord_impl to ensure PartialOrd and Ord agree
  • Loading branch information
jeremyandrews authored Nov 1, 2023
2 parents e7aea3b + 10c4589 commit 6b0803e
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,16 +570,7 @@ impl<T: Clone + TimeSeriesValue<T, U>, U: PartialEq + PartialOrd> Ord for TimeSe

impl<T: Clone + TimeSeriesValue<T, U>, U: PartialEq + PartialOrd> PartialOrd for TimeSeries<T, U> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
let self_total = self.total();
let other_total = other.total();

if self_total > other_total {
Some(Ordering::Greater)
} else if self_total < other_total {
Some(Ordering::Less)
} else {
Some(Ordering::Equal)
}
Some(self.cmp(other))
}
}

Expand Down

0 comments on commit 6b0803e

Please sign in to comment.