From 10c45891f122e931f2917cf184a5fc76d4a74c7b Mon Sep 17 00:00:00 2001 From: Jeremy Andrews Date: Tue, 31 Oct 2023 08:24:21 +0100 Subject: [PATCH] fix non_canonical_partial_ord_impl to ensure PartialOrd and Ord agree --- src/graph.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/graph.rs b/src/graph.rs index f0baa635..1c443223 100644 --- a/src/graph.rs +++ b/src/graph.rs @@ -570,16 +570,7 @@ impl, U: PartialEq + PartialOrd> Ord for TimeSe impl, U: PartialEq + PartialOrd> PartialOrd for TimeSeries { fn partial_cmp(&self, other: &Self) -> Option { - 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)) } }