refactor: use is_none_or instead of map_or (#13035)

This commit is contained in:
Hoa Nguyen
2024-11-30 18:09:49 +07:00
committed by GitHub
parent 5d71150355
commit 0ff2827a79
8 changed files with 9 additions and 9 deletions

View File

@ -461,7 +461,7 @@ impl FinalizedBlockTracker {
let finalized = finalized_block?;
self.last_finalized_block
.replace(finalized)
.map_or(true, |last| last < finalized)
.is_none_or(|last| last < finalized)
.then_some(finalized)
}
}

View File

@ -57,7 +57,7 @@ impl<T: TransactionOrdering> Iterator for BestTransactionsWithFees<T> {
if best.transaction.max_fee_per_gas() >= self.base_fee as u128 &&
best.transaction
.max_fee_per_blob_gas()
.map_or(true, |fee| fee >= self.base_fee_per_blob_gas as u128)
.is_none_or(|fee| fee >= self.base_fee_per_blob_gas as u128)
{
return Some(best);
}