From 11fd7a2844c08cdefb8ccaa249af512dacf3c729 Mon Sep 17 00:00:00 2001 From: rakita Date: Tue, 5 Dec 2023 16:50:34 +0300 Subject: [PATCH] chore: remove trailing semicolon (#5699) --- bin/reth/src/args/network_args.rs | 2 +- bin/reth/src/args/payload_builder_args.rs | 2 +- crates/interfaces/src/consensus.rs | 4 +--- crates/primitives/src/transaction/signature.rs | 6 +++--- crates/primitives/src/trie/nibbles.rs | 2 +- crates/transaction-pool/src/pool/parked.rs | 6 +++--- crates/transaction-pool/src/pool/pending.rs | 10 +++++----- crates/transaction-pool/src/test_utils/mock.rs | 4 ++-- 8 files changed, 17 insertions(+), 19 deletions(-) diff --git a/bin/reth/src/args/network_args.rs b/bin/reth/src/args/network_args.rs index 2014468d6..fd9c88d6c 100644 --- a/bin/reth/src/args/network_args.rs +++ b/bin/reth/src/args/network_args.rs @@ -118,7 +118,7 @@ impl NetworkArgs { /// If `no_persist_peers` is true then this returns the path to the persistent peers file path. pub fn persistent_peers_file(&self, peers_file: PathBuf) -> Option { if self.no_persist_peers { - return None; + return None } Some(peers_file) diff --git a/bin/reth/src/args/payload_builder_args.rs b/bin/reth/src/args/payload_builder_args.rs index 1619e7bd9..d7453372b 100644 --- a/bin/reth/src/args/payload_builder_args.rs +++ b/bin/reth/src/args/payload_builder_args.rs @@ -110,7 +110,7 @@ impl TypedValueParser for ExtradataValueParser { format!( "Payload builder extradata size exceeds {MAXIMUM_EXTRA_DATA_SIZE}bytes limit" ), - )); + )) } Ok(val.to_string()) } diff --git a/crates/interfaces/src/consensus.rs b/crates/interfaces/src/consensus.rs index a1412fa44..166111cb7 100644 --- a/crates/interfaces/src/consensus.rs +++ b/crates/interfaces/src/consensus.rs @@ -38,9 +38,7 @@ pub trait Consensus: Debug + Send + Sync { /// Note: this expects that the headers are in natural order (ascending block number) fn validate_header_range(&self, headers: &[SealedHeader]) -> Result<(), ConsensusError> { let mut headers = headers.iter(); - let Some(mut parent) = headers.next() else { - return Ok(()); - }; + let Some(mut parent) = headers.next() else { return Ok(()) }; self.validate_header(parent)?; for child in headers { self.validate_header(child)?; diff --git a/crates/primitives/src/transaction/signature.rs b/crates/primitives/src/transaction/signature.rs index 209e4aaa6..6d051633b 100644 --- a/crates/primitives/src/transaction/signature.rs +++ b/crates/primitives/src/transaction/signature.rs @@ -80,7 +80,7 @@ impl Signature { pub fn v(&self, chain_id: Option) -> u64 { #[cfg(feature = "optimism")] if self.r.is_zero() && self.s.is_zero() { - return 0; + return 0 } if let Some(chain_id) = chain_id { @@ -107,7 +107,7 @@ impl Signature { } else { // non-EIP-155 legacy scheme, v = 27 for even y-parity, v = 28 for odd y-parity if v != 27 && v != 28 { - return Err(RlpError::Custom("invalid Ethereum signature (V is not 27 or 28)")); + return Err(RlpError::Custom("invalid Ethereum signature (V is not 27 or 28)")) } let odd_y_parity = v == 28; Ok((Signature { r, s, odd_y_parity }, None)) @@ -160,7 +160,7 @@ impl Signature { /// If the S value is too large, then this will return `None` pub fn recover_signer(&self, hash: B256) -> Option
{ if self.s > SECP256K1N_HALF { - return None; + return None } self.recover_signer_unchecked(hash) diff --git a/crates/primitives/src/trie/nibbles.rs b/crates/primitives/src/trie/nibbles.rs index 7c6d92a2b..f813f9309 100644 --- a/crates/primitives/src/trie/nibbles.rs +++ b/crates/primitives/src/trie/nibbles.rs @@ -424,7 +424,7 @@ impl Nibbles { debug_assert!(*nibble <= 0xf); if *nibble < 0xf { *nibble += 1; - return Some(incremented); + return Some(incremented) } else { *nibble = 0; } diff --git a/crates/transaction-pool/src/pool/parked.rs b/crates/transaction-pool/src/pool/parked.rs index d985ea4cf..13887ac3f 100644 --- a/crates/transaction-pool/src/pool/parked.rs +++ b/crates/transaction-pool/src/pool/parked.rs @@ -152,7 +152,7 @@ impl ParkedPool { ) -> Vec>> { if self.len() <= limit.max_txs { // if we are below the limits, we don't need to drop anything - return Vec::new(); + return Vec::new() } let mut removed = Vec::new(); @@ -173,7 +173,7 @@ impl ParkedPool { } } drop -= list.len(); - continue; + continue } // Otherwise drop only last few transactions @@ -252,7 +252,7 @@ impl ParkedPool> { // still parked -> skip descendant transactions 'this: while let Some((peek, _)) = iter.peek() { if peek.sender != id.sender { - break 'this; + break 'this } iter.next(); } diff --git a/crates/transaction-pool/src/pool/pending.rs b/crates/transaction-pool/src/pool/pending.rs index 44409c685..3ae5569a1 100644 --- a/crates/transaction-pool/src/pool/pending.rs +++ b/crates/transaction-pool/src/pool/pending.rs @@ -185,7 +185,7 @@ impl PendingPool { // Remove all dependent transactions. 'this: while let Some((next_id, next_tx)) = transactions_iter.peek() { if next_id.sender != id.sender { - break 'this; + break 'this } removed.push(Arc::clone(&next_tx.transaction)); transactions_iter.next(); @@ -228,7 +228,7 @@ impl PendingPool { // Remove all dependent transactions. 'this: while let Some((next_id, next_tx)) = transactions_iter.peek() { if next_id.sender != id.sender { - break 'this; + break 'this } removed.push(Arc::clone(&next_tx.transaction)); transactions_iter.next(); @@ -420,12 +420,12 @@ impl PendingPool { } } - return; + return } if !remove_locals && tx.transaction.is_local() { non_local_senders -= 1; - continue; + continue } total_size += tx.transaction.size(); @@ -460,7 +460,7 @@ impl PendingPool { self.remove_to_limit(&limit, false, &mut removed); if self.size() <= limit.max_size && self.len() <= limit.max_txs { - return removed; + return removed } // now repeat for local transactions diff --git a/crates/transaction-pool/src/test_utils/mock.rs b/crates/transaction-pool/src/test_utils/mock.rs index a1c778af8..200a7c092 100644 --- a/crates/transaction-pool/src/test_utils/mock.rs +++ b/crates/transaction-pool/src/test_utils/mock.rs @@ -637,12 +637,12 @@ impl PoolTransaction for MockTransaction { let base_fee = base_fee as u128; let max_fee_per_gas = self.max_fee_per_gas(); if max_fee_per_gas < base_fee { - return None; + return None } let fee = max_fee_per_gas - base_fee; if let Some(priority_fee) = self.max_priority_fee_per_gas() { - return Some(fee.min(priority_fee)); + return Some(fee.min(priority_fee)) } Some(fee)