From d42f4a3b205e2e9033e01fc5619b2ef2a6ab5861 Mon Sep 17 00:00:00 2001 From: Sovenok-Hacker Date: Sun, 28 Apr 2024 09:07:29 +0300 Subject: [PATCH] Fix the last clippy warning --- src/transaction.rs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/transaction.rs b/src/transaction.rs index adf5c7a..0e53568 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -42,23 +42,7 @@ impl Ord for TransactionableItem { impl PartialOrd for TransactionableItem { fn partial_cmp(&self, other: &Self) -> Option { - Some(match self.get_timestamp().cmp(&other.get_timestamp()) { - Ordering::Less => Ordering::Greater, - Ordering::Equal => { - let tr_hash: [u64; 4] = unsafe { transmute(self.hash()) }; - let other_hash: [u64; 4] = unsafe { transmute(other.hash()) }; - - for (left, right) in tr_hash.iter().zip(other_hash.iter()) { - match left.cmp(right) { - Ordering::Less => return Some(Ordering::Greater), - Ordering::Equal => {} - Ordering::Greater => return Some(Ordering::Less), - } - } - Ordering::Equal - } - Ordering::Greater => Ordering::Less, - }) + Some(self.cmp(other)) } }