add match_same_arms clippy lint (#8549)

This commit is contained in:
Thomas Coratger
2024-06-03 19:42:25 +02:00
committed by GitHub
parent 0f1bad98f2
commit e02b935e94
34 changed files with 259 additions and 310 deletions

View File

@ -92,6 +92,7 @@ impl PoolError {
/// erroneous transaction.
#[inline]
pub fn is_bad_transaction(&self) -> bool {
#[allow(clippy::match_same_arms)]
match &self.kind {
PoolErrorKind::AlreadyImported => {
// already imported but not bad
@ -213,6 +214,7 @@ impl InvalidPoolTransactionError {
/// context of the transaction pool and warrants peer penalization.
///
/// See [`PoolError::is_bad_transaction`].
#[allow(clippy::match_same_arms)]
#[inline]
fn is_bad_transaction(&self) -> bool {
match self {
@ -243,10 +245,10 @@ impl InvalidPoolTransactionError {
// settings
false
}
InvalidTransactionError::OldLegacyChainId => true,
InvalidTransactionError::ChainIdMismatch => true,
InvalidTransactionError::GasUintOverflow => true,
InvalidTransactionError::TxTypeNotSupported => true,
InvalidTransactionError::OldLegacyChainId |
InvalidTransactionError::ChainIdMismatch |
InvalidTransactionError::GasUintOverflow |
InvalidTransactionError::TxTypeNotSupported |
InvalidTransactionError::SignerAccountHasBytecode => true,
}
}

View File

@ -1036,7 +1036,7 @@ impl PoolTransaction for EthPooledTransaction {
///
/// This will return `None` for non-EIP1559 transactions
fn max_priority_fee_per_gas(&self) -> Option<u128> {
#[allow(unreachable_patterns)]
#[allow(unreachable_patterns, clippy::match_same_arms)]
match &self.transaction.transaction {
Transaction::Legacy(_) | Transaction::Eip2930(_) => None,
Transaction::Eip1559(tx) => Some(tx.max_priority_fee_per_gas),