chore: remove trailing semicolon (#5699)

This commit is contained in:
rakita
2023-12-05 16:50:34 +03:00
committed by GitHub
parent 8d8700a5c0
commit 11fd7a2844
8 changed files with 17 additions and 19 deletions

View File

@ -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<PathBuf> {
if self.no_persist_peers {
return None;
return None
}
Some(peers_file)

View File

@ -110,7 +110,7 @@ impl TypedValueParser for ExtradataValueParser {
format!(
"Payload builder extradata size exceeds {MAXIMUM_EXTRA_DATA_SIZE}bytes limit"
),
));
))
}
Ok(val.to_string())
}

View File

@ -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)?;

View File

@ -80,7 +80,7 @@ impl Signature {
pub fn v(&self, chain_id: Option<u64>) -> 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<Address> {
if self.s > SECP256K1N_HALF {
return None;
return None
}
self.recover_signer_unchecked(hash)

View File

@ -424,7 +424,7 @@ impl Nibbles {
debug_assert!(*nibble <= 0xf);
if *nibble < 0xf {
*nibble += 1;
return Some(incremented);
return Some(incremented)
} else {
*nibble = 0;
}

View File

@ -152,7 +152,7 @@ impl<T: ParkedOrd> ParkedPool<T> {
) -> Vec<Arc<ValidPoolTransaction<T::Transaction>>> {
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<T: ParkedOrd> ParkedPool<T> {
}
}
drop -= list.len();
continue;
continue
}
// Otherwise drop only last few transactions
@ -252,7 +252,7 @@ impl<T: PoolTransaction> ParkedPool<BasefeeOrd<T>> {
// still parked -> skip descendant transactions
'this: while let Some((peek, _)) = iter.peek() {
if peek.sender != id.sender {
break 'this;
break 'this
}
iter.next();
}

View File

@ -185,7 +185,7 @@ impl<T: TransactionOrdering> PendingPool<T> {
// 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<T: TransactionOrdering> PendingPool<T> {
// 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<T: TransactionOrdering> PendingPool<T> {
}
}
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<T: TransactionOrdering> PendingPool<T> {
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

View File

@ -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)