From 757ddf56075174f398efd2c4427c11e2092e67cd Mon Sep 17 00:00:00 2001 From: Justin Traglia Date: Tue, 19 Mar 2024 08:14:48 -0500 Subject: [PATCH] Enable clippy's branches_sharing_code linter --- Cargo.toml | 1 + crates/transaction-pool/src/pool/pending.rs | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a8d455eb2863..6293c3542f24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,6 +92,7 @@ clippy.derive_partial_eq_without_eq = "deny" clippy.redundant_clone = "deny" clippy.trait_duplication_in_bounds = "deny" clippy.uninlined_format_args = "deny" +clippy.branches_sharing_code = "deny" [workspace.package] version = "0.2.0-beta.3" diff --git a/crates/transaction-pool/src/pool/pending.rs b/crates/transaction-pool/src/pool/pending.rs index 34678b7289c8..2ca76222577b 100644 --- a/crates/transaction-pool/src/pool/pending.rs +++ b/crates/transaction-pool/src/pool/pending.rs @@ -264,13 +264,12 @@ impl PendingPool { // the transaction already has an ancestor, so we only need to ensure that the // highest nonces set actually contains the highest nonce for that sender self.highest_nonces.remove(ancestor); - self.highest_nonces.insert(tx.clone()); } else { // If there's __no__ ancestor in the pool, then this transaction is independent, this is // guaranteed because this pool is gapless. self.independent_transactions.insert(tx.clone()); - self.highest_nonces.insert(tx.clone()); } + self.highest_nonces.insert(tx.clone()); } /// Returns the ancestor the given transaction, the transaction with `nonce - 1`.