Skip to content

Commit

Permalink
Fix the last clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Sovenok-Hacker committed Apr 28, 2024
1 parent f8d2df4 commit d42f4a3
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,7 @@ impl Ord for TransactionableItem {

impl PartialOrd for TransactionableItem {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
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))
}
}

Expand Down

0 comments on commit d42f4a3

Please sign in to comment.