From 9a80f32a66e3fae04a07847ab1041ea849bbf17b Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Mon, 14 Aug 2023 19:58:29 +0200 Subject: [PATCH] chore(clippy): make clippy happy (#4163) --- crates/transaction-pool/benches/reorder.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/transaction-pool/benches/reorder.rs b/crates/transaction-pool/benches/reorder.rs index 129f1c17ff..b50598e299 100644 --- a/crates/transaction-pool/benches/reorder.rs +++ b/crates/transaction-pool/benches/reorder.rs @@ -1,5 +1,5 @@ use criterion::{ - black_box, criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion, + criterion_group, criterion_main, measurement::WallTime, BenchmarkGroup, Criterion, }; use proptest::{ prelude::*, @@ -78,7 +78,7 @@ fn txpool_reordering_bench( ); group.bench_function(group_id, |b| { b.iter_with_setup(setup, |(mut txpool, new_txs)| { - black_box({ + { // Reorder with new base fee let bigger_base_fee = base_fee.saturating_add(10); txpool.reorder(bigger_base_fee); @@ -88,8 +88,9 @@ fn txpool_reordering_bench( txpool.add_transaction(new_tx); } let smaller_base_fee = base_fee.saturating_sub(10); - txpool.reorder(smaller_base_fee); - }) + txpool.reorder(smaller_base_fee) + }; + std::hint::black_box(()); }); }); } @@ -177,7 +178,7 @@ mod implementations { impl PartialOrd for MockTransactionWithPriority { fn partial_cmp(&self, other: &Self) -> Option { - self.priority.partial_cmp(&other.priority) + Some(self.cmp(other)) } }