From a5fa713a597b50e5051ee59d1789cac3f1af86ae Mon Sep 17 00:00:00 2001 From: Yihau Chen Date: Wed, 29 May 2024 19:07:47 +0800 Subject: [PATCH] chore: remove unused clippy attributes, redundant_closure (#1513) remove clippy redundant_closure --- cli/src/nonce.rs | 1 - cli/tests/nonce.rs | 1 - cli/tests/stake.rs | 1 - cli/tests/transfer.rs | 1 - rpc-client-nonce-utils/src/blockhash_query.rs | 3 --- rpc-client-nonce-utils/src/nonblocking/blockhash_query.rs | 2 -- sdk/src/precompiles.rs | 1 - 7 files changed, 10 deletions(-) diff --git a/cli/src/nonce.rs b/cli/src/nonce.rs index c88ffdd2670601..38585b9b99be78 100644 --- a/cli/src/nonce.rs +++ b/cli/src/nonce.rs @@ -526,7 +526,6 @@ pub fn process_get_nonce( config: &CliConfig, nonce_account_pubkey: &Pubkey, ) -> ProcessResult { - #[allow(clippy::redundant_closure)] match get_account_with_commitment(rpc_client, nonce_account_pubkey, config.commitment) .and_then(|ref a| state_from_account(a))? { diff --git a/cli/tests/nonce.rs b/cli/tests/nonce.rs index d3ece033f6264e..ff305e3954e46f 100644 --- a/cli/tests/nonce.rs +++ b/cli/tests/nonce.rs @@ -240,7 +240,6 @@ fn full_battery_tests( } #[test] -#[allow(clippy::redundant_closure)] fn test_create_account_with_seed() { const ONE_SIG_FEE: f64 = 0.000005; solana_logger::setup(); diff --git a/cli/tests/stake.rs b/cli/tests/stake.rs index ecaf5a73748390..217e073f1c3ada 100644 --- a/cli/tests/stake.rs +++ b/cli/tests/stake.rs @@ -1,5 +1,4 @@ #![allow(clippy::arithmetic_side_effects)] -#![allow(clippy::redundant_closure)] use { assert_matches::assert_matches, solana_cli::{ diff --git a/cli/tests/transfer.rs b/cli/tests/transfer.rs index f75ca52266c50b..e5ebac60976814 100644 --- a/cli/tests/transfer.rs +++ b/cli/tests/transfer.rs @@ -1,5 +1,4 @@ #![allow(clippy::arithmetic_side_effects)] -#![allow(clippy::redundant_closure)] use { solana_cli::{ check_balance, diff --git a/rpc-client-nonce-utils/src/blockhash_query.rs b/rpc-client-nonce-utils/src/blockhash_query.rs index 08a296a70b7125..20b3e0572ff9f6 100644 --- a/rpc-client-nonce-utils/src/blockhash_query.rs +++ b/rpc-client-nonce-utils/src/blockhash_query.rs @@ -34,7 +34,6 @@ impl Source { Ok((res.0, res.1)) } Self::NonceAccount(ref pubkey) => { - #[allow(clippy::redundant_closure)] let data = crate::get_account_with_commitment(rpc_client, pubkey, commitment) .and_then(|ref a| crate::data_from_account(a))?; Ok((data.blockhash(), data.fee_calculator)) @@ -81,7 +80,6 @@ impl Source { Ok(blockhash) } Self::NonceAccount(ref pubkey) => { - #[allow(clippy::redundant_closure)] let data = crate::get_account_with_commitment(rpc_client, pubkey, commitment) .and_then(|ref a| crate::data_from_account(a))?; Ok(data.blockhash()) @@ -98,7 +96,6 @@ impl Source { Ok(match self { Self::Cluster => rpc_client.is_blockhash_valid(blockhash, commitment)?, Self::NonceAccount(ref pubkey) => { - #[allow(clippy::redundant_closure)] let _ = crate::get_account_with_commitment(rpc_client, pubkey, commitment) .and_then(|ref a| crate::data_from_account(a))?; true diff --git a/rpc-client-nonce-utils/src/nonblocking/blockhash_query.rs b/rpc-client-nonce-utils/src/nonblocking/blockhash_query.rs index 879bfe5f622441..07f03cae68cbe5 100644 --- a/rpc-client-nonce-utils/src/nonblocking/blockhash_query.rs +++ b/rpc-client-nonce-utils/src/nonblocking/blockhash_query.rs @@ -30,7 +30,6 @@ impl Source { Ok(blockhash) } Self::NonceAccount(ref pubkey) => { - #[allow(clippy::redundant_closure)] let data = nonblocking::get_account_with_commitment(rpc_client, pubkey, commitment) .await .and_then(|ref a| nonblocking::data_from_account(a))?; @@ -48,7 +47,6 @@ impl Source { Ok(match self { Self::Cluster => rpc_client.is_blockhash_valid(blockhash, commitment).await?, Self::NonceAccount(ref pubkey) => { - #[allow(clippy::redundant_closure)] let _ = nonblocking::get_account_with_commitment(rpc_client, pubkey, commitment) .await .and_then(|ref a| nonblocking::data_from_account(a))?; diff --git a/sdk/src/precompiles.rs b/sdk/src/precompiles.rs index 6270c82f4eb223..34885b05e287a9 100644 --- a/sdk/src/precompiles.rs +++ b/sdk/src/precompiles.rs @@ -57,7 +57,6 @@ impl Precompile { where F: Fn(&Pubkey) -> bool, { - #![allow(clippy::redundant_closure)] self.feature .map_or(true, |ref feature_id| is_enabled(feature_id)) && self.program_id == *program_id