From 963eb212d619edd961b5e7e9e9279fa7271f5d87 Mon Sep 17 00:00:00 2001 From: frisitano Date: Mon, 2 Dec 2024 13:23:01 +0800 Subject: [PATCH] fmt --- crates/net/eth-wire/src/capability.rs | 3 ++- crates/transaction-pool/src/maintain.rs | 3 ++- crates/transaction-pool/src/pool/best.rs | 3 ++- crates/trie/trie/src/trie_cursor/subnode.rs | 6 ++++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/net/eth-wire/src/capability.rs b/crates/net/eth-wire/src/capability.rs index 06790c52c4a3..8d969eac889b 100644 --- a/crates/net/eth-wire/src/capability.rs +++ b/crates/net/eth-wire/src/capability.rs @@ -318,7 +318,8 @@ pub fn shared_capability_offsets( // If multiple versions are shared of the same (equal name) capability, the numerically // highest wins, others are ignored if shared_capabilities - .get(&peer_capability.name).is_none_or(|v| peer_capability.version > v.version) + .get(&peer_capability.name) + .is_none_or(|v| peer_capability.version > v.version) { shared_capabilities.insert( peer_capability.name.clone(), diff --git a/crates/transaction-pool/src/maintain.rs b/crates/transaction-pool/src/maintain.rs index 7826a0e3406e..6763deb02e60 100644 --- a/crates/transaction-pool/src/maintain.rs +++ b/crates/transaction-pool/src/maintain.rs @@ -460,7 +460,8 @@ impl FinalizedBlockTracker { fn update(&mut self, finalized_block: Option) -> Option { let finalized = finalized_block?; self.last_finalized_block - .replace(finalized).is_none_or(|last| last < finalized) + .replace(finalized) + .is_none_or(|last| last < finalized) .then_some(finalized) } } diff --git a/crates/transaction-pool/src/pool/best.rs b/crates/transaction-pool/src/pool/best.rs index 284487e14a11..ed94bc676236 100644 --- a/crates/transaction-pool/src/pool/best.rs +++ b/crates/transaction-pool/src/pool/best.rs @@ -56,7 +56,8 @@ impl Iterator for BestTransactionsWithFees { // the transaction if best.transaction.max_fee_per_gas() >= self.base_fee as u128 && best.transaction - .max_fee_per_blob_gas().is_none_or(|fee| fee >= self.base_fee_per_blob_gas as u128) + .max_fee_per_blob_gas() + .is_none_or(|fee| fee >= self.base_fee_per_blob_gas as u128) { return Some(best); } diff --git a/crates/trie/trie/src/trie_cursor/subnode.rs b/crates/trie/trie/src/trie_cursor/subnode.rs index c51b713d59a6..457c1ba4685b 100644 --- a/crates/trie/trie/src/trie_cursor/subnode.rs +++ b/crates/trie/trie/src/trie_cursor/subnode.rs @@ -75,14 +75,16 @@ impl CursorSubNode { #[inline] pub fn state_flag(&self) -> bool { self.node - .as_ref().is_none_or(|node| self.nibble < 0 || node.state_mask.is_bit_set(self.nibble as u8)) + .as_ref() + .is_none_or(|node| self.nibble < 0 || node.state_mask.is_bit_set(self.nibble as u8)) } /// Returns `true` if the tree flag is set for the current nibble. #[inline] pub fn tree_flag(&self) -> bool { self.node - .as_ref().is_none_or(|node| self.nibble < 0 || node.tree_mask.is_bit_set(self.nibble as u8)) + .as_ref() + .is_none_or(|node| self.nibble < 0 || node.tree_mask.is_bit_set(self.nibble as u8)) } /// Returns `true` if the current nibble has a root hash.