diff --git a/accounts-db/src/accounts.rs b/accounts-db/src/accounts.rs index 96770405dd7802..b4963b4ea60bb2 100644 --- a/accounts-db/src/accounts.rs +++ b/accounts-db/src/accounts.rs @@ -596,7 +596,6 @@ impl Accounts { /// This function will prevent multiple threads from modifying the same account state at the /// same time #[must_use] - #[allow(clippy::needless_collect)] pub fn lock_accounts<'a>( &self, txs: impl Iterator, @@ -609,7 +608,6 @@ impl Accounts { } #[must_use] - #[allow(clippy::needless_collect)] pub fn lock_accounts_with_results<'a>( &self, txs: impl Iterator, @@ -646,7 +644,6 @@ impl Accounts { } /// Once accounts are unlocked, new transactions that modify that state can enter the pipeline - #[allow(clippy::needless_collect)] pub fn unlock_accounts<'a>( &self, txs_and_results: impl Iterator)>, diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index 245ca8c7b30284..03c85d405d5517 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -6003,7 +6003,6 @@ impl AccountsDb { ); } - #[allow(clippy::needless_collect)] fn purge_slots<'a>(&self, slots: impl Iterator + Clone) { // `add_root()` should be called first let mut safety_checks_elapsed = Measure::start("safety_checks_elapsed"); diff --git a/accounts-db/src/accounts_index.rs b/accounts-db/src/accounts_index.rs index bea586d762342f..e41d71c051f254 100644 --- a/accounts-db/src/accounts_index.rs +++ b/accounts-db/src/accounts_index.rs @@ -1632,7 +1632,6 @@ impl + Into> AccountsIndex { // But, does NOT update secondary index // This is designed to be called at startup time. // returns (dirty_pubkeys, insertion_time_us, GenerateIndexResult) - #[allow(clippy::needless_collect)] pub(crate) fn insert_new_if_missing_into_primary_index( &self, slot: Slot, diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index 4e95789c374230..3b578e994a0c96 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -2307,7 +2307,6 @@ impl ClusterInfo { } } - #[allow(clippy::needless_collect)] fn handle_batch_push_messages( &self, messages: Vec<(Pubkey, Vec)>, @@ -3357,7 +3356,6 @@ mod tests { } #[test] - #[allow(clippy::needless_collect)] fn test_handle_ping_messages() { let mut rng = rand::thread_rng(); let this_node = Arc::new(Keypair::new()); @@ -4156,7 +4154,6 @@ mod tests { } #[test] - #[allow(clippy::needless_collect)] fn test_split_messages_packet_size() { // Test that if a value is smaller than payload size but too large to be wrapped in a vec // that it is still dropped diff --git a/gossip/src/crds.rs b/gossip/src/crds.rs index 1c2e427f0e0e31..73d2dd0d1c9f26 100644 --- a/gossip/src/crds.rs +++ b/gossip/src/crds.rs @@ -1383,7 +1383,6 @@ mod tests { } #[test] - #[allow(clippy::needless_collect)] fn test_drop() { fn num_unique_pubkeys<'a, I>(values: I) -> usize where diff --git a/perf/src/recycler.rs b/perf/src/recycler.rs index 6251f4a5e4e1eb..3053d5717a913c 100644 --- a/perf/src/recycler.rs +++ b/perf/src/recycler.rs @@ -87,7 +87,6 @@ fn warm_recyclers() -> bool { } impl Recycler { - #[allow(clippy::needless_collect)] pub fn warmed(num: usize, size_hint: usize) -> Self { let new = Self::default(); if warm_recyclers() { diff --git a/programs/sbf/tests/programs.rs b/programs/sbf/tests/programs.rs index 566f3855b1a697..fa77f9844da6b1 100644 --- a/programs/sbf/tests/programs.rs +++ b/programs/sbf/tests/programs.rs @@ -4,7 +4,6 @@ #![allow(clippy::redundant_clone)] #![allow(clippy::needless_borrow)] #![allow(clippy::cmp_owned)] -#![allow(clippy::needless_collect)] #![allow(clippy::match_like_matches_macro)] #![allow(clippy::unnecessary_cast)] #![allow(clippy::uninlined_format_args)] diff --git a/runtime/src/bank/fee_distribution.rs b/runtime/src/bank/fee_distribution.rs index 223be2ec52ce1a..671dba8ac2e9cb 100644 --- a/runtime/src/bank/fee_distribution.rs +++ b/runtime/src/bank/fee_distribution.rs @@ -210,7 +210,6 @@ impl Bank { // fees // // Ref: distribute_transaction_fees - #[allow(clippy::needless_collect)] fn distribute_rent_to_validators( &self, vote_accounts: &VoteAccountsHashMap, diff --git a/runtime/src/bank_forks.rs b/runtime/src/bank_forks.rs index 8bdcb0881d9cfd..e373c7ab5dcb30 100644 --- a/runtime/src/bank_forks.rs +++ b/runtime/src/bank_forks.rs @@ -642,10 +642,8 @@ impl BankForks { root: Slot, highest_super_majority_root: Option, ) -> (Vec, u64, u64) { - // Clippy doesn't like separating the two collects below, - // but we want to collect timing separately, and the 2nd requires + // We want to collect timing separately, and the 2nd collect requires // a unique borrow to self which is already borrowed by self.banks - #![allow(clippy::needless_collect)] let mut prune_slots_time = Measure::start("prune_slots"); let highest_super_majority_root = highest_super_majority_root.unwrap_or(root); let prune_slots: Vec<_> = self diff --git a/runtime/src/snapshot_utils.rs b/runtime/src/snapshot_utils.rs index e065ab640f114f..9db2fe0ce47f42 100644 --- a/runtime/src/snapshot_utils.rs +++ b/runtime/src/snapshot_utils.rs @@ -1602,7 +1602,6 @@ fn streaming_unarchive_snapshot( let shared_buffer = untar_snapshot_create_shared_buffer(&snapshot_archive_path, archive_format); // All shared buffer readers need to be created before the threads are spawned - #[allow(clippy::needless_collect)] let archives: Vec<_> = (0..num_threads) .map(|_| { let reader = SharedBufferReader::new(&shared_buffer); diff --git a/tokens/src/commands.rs b/tokens/src/commands.rs index 6bde5d997146a8..e5f4b6b8aba57f 100644 --- a/tokens/src/commands.rs +++ b/tokens/src/commands.rs @@ -504,7 +504,6 @@ fn distribute_allocations( Ok(()) } -#[allow(clippy::needless_collect)] fn read_allocations( input_csv: &str, transfer_amount: Option,