From 3442f184f7493f1925d8ac8103852cbe1c632592 Mon Sep 17 00:00:00 2001 From: Tyera Date: Mon, 3 Apr 2023 20:35:20 -0600 Subject: [PATCH] Remove unneeded `clippy::new_ret_no_self` allows (#31035) Remove unneeded allows --- core/src/cache_block_meta_service.rs | 1 - core/src/cost_update_service.rs | 1 - core/src/fetch_stage.rs | 1 - core/src/replay_stage.rs | 2 +- core/src/rewards_recorder_service.rs | 1 - core/src/sample_performance_service.rs | 1 - core/src/sigverify_stage.rs | 1 - core/src/tvu.rs | 2 +- rpc/src/transaction_status_service.rs | 1 - zk-token-sdk/src/encryption/auth_encryption.rs | 1 - zk-token-sdk/src/encryption/elgamal.rs | 1 - 11 files changed, 2 insertions(+), 11 deletions(-) diff --git a/core/src/cache_block_meta_service.rs b/core/src/cache_block_meta_service.rs index a8da9ac096..507149b13d 100644 --- a/core/src/cache_block_meta_service.rs +++ b/core/src/cache_block_meta_service.rs @@ -23,7 +23,6 @@ pub struct CacheBlockMetaService { const CACHE_BLOCK_TIME_WARNING_MS: u64 = 150; impl CacheBlockMetaService { - #[allow(clippy::new_ret_no_self)] pub fn new( cache_block_meta_receiver: CacheBlockMetaReceiver, blockstore: Arc, diff --git a/core/src/cost_update_service.rs b/core/src/cost_update_service.rs index 8565a4c1bb..6b49c8fdf1 100644 --- a/core/src/cost_update_service.rs +++ b/core/src/cost_update_service.rs @@ -20,7 +20,6 @@ pub struct CostUpdateService { } impl CostUpdateService { - #[allow(clippy::new_ret_no_self)] pub fn new(blockstore: Arc, cost_update_receiver: CostUpdateReceiver) -> Self { let thread_hdl = Builder::new() .name("solCostUpdtSvc".to_string()) diff --git a/core/src/fetch_stage.rs b/core/src/fetch_stage.rs index 85622f1e7e..196770a1ea 100644 --- a/core/src/fetch_stage.rs +++ b/core/src/fetch_stage.rs @@ -30,7 +30,6 @@ pub struct FetchStage { } impl FetchStage { - #[allow(clippy::new_ret_no_self)] pub fn new( sockets: Vec, tpu_forwards_sockets: Vec, diff --git a/core/src/replay_stage.rs b/core/src/replay_stage.rs index 7200410602..825a01c715 100644 --- a/core/src/replay_stage.rs +++ b/core/src/replay_stage.rs @@ -378,7 +378,7 @@ pub struct ReplayStage { } impl ReplayStage { - #[allow(clippy::new_ret_no_self, clippy::too_many_arguments)] + #[allow(clippy::too_many_arguments)] pub fn new( config: ReplayStageConfig, blockstore: Arc, diff --git a/core/src/rewards_recorder_service.rs b/core/src/rewards_recorder_service.rs index d83b0a285f..092b6eae1a 100644 --- a/core/src/rewards_recorder_service.rs +++ b/core/src/rewards_recorder_service.rs @@ -28,7 +28,6 @@ pub struct RewardsRecorderService { } impl RewardsRecorderService { - #[allow(clippy::new_ret_no_self)] pub fn new( rewards_receiver: RewardsRecorderReceiver, max_complete_rewards_slot: Arc, diff --git a/core/src/sample_performance_service.rs b/core/src/sample_performance_service.rs index e9183842e9..a5395d78ea 100644 --- a/core/src/sample_performance_service.rs +++ b/core/src/sample_performance_service.rs @@ -19,7 +19,6 @@ pub struct SamplePerformanceService { } impl SamplePerformanceService { - #[allow(clippy::new_ret_no_self)] pub fn new( bank_forks: &Arc>, blockstore: &Arc, diff --git a/core/src/sigverify_stage.rs b/core/src/sigverify_stage.rs index 62f614333c..d9c69f862d 100644 --- a/core/src/sigverify_stage.rs +++ b/core/src/sigverify_stage.rs @@ -235,7 +235,6 @@ impl SigVerifier for DisabledSigVerifier { } impl SigVerifyStage { - #[allow(clippy::new_ret_no_self)] pub fn new( packet_receiver: FindPacketSenderStakeReceiver, verifier: T, diff --git a/core/src/tvu.rs b/core/src/tvu.rs index 5bcc13f901..ca4cd961fc 100644 --- a/core/src/tvu.rs +++ b/core/src/tvu.rs @@ -100,7 +100,7 @@ impl Tvu { /// * `cluster_info` - The cluster_info state. /// * `sockets` - fetch, repair, and retransmit sockets /// * `blockstore` - the ledger itself - #[allow(clippy::new_ret_no_self, clippy::too_many_arguments)] + #[allow(clippy::too_many_arguments)] pub fn new( vote_account: &Pubkey, authorized_voter_keypairs: Arc>>>, diff --git a/rpc/src/transaction_status_service.rs b/rpc/src/transaction_status_service.rs index 9fbfe879e2..8b829ca7c9 100644 --- a/rpc/src/transaction_status_service.rs +++ b/rpc/src/transaction_status_service.rs @@ -25,7 +25,6 @@ pub struct TransactionStatusService { } impl TransactionStatusService { - #[allow(clippy::new_ret_no_self)] pub fn new( write_transaction_status_receiver: Receiver, max_complete_transaction_status_slot: Arc, diff --git a/zk-token-sdk/src/encryption/auth_encryption.rs b/zk-token-sdk/src/encryption/auth_encryption.rs index 50a7223045..92e332fd6e 100644 --- a/zk-token-sdk/src/encryption/auth_encryption.rs +++ b/zk-token-sdk/src/encryption/auth_encryption.rs @@ -26,7 +26,6 @@ use { struct AuthenticatedEncryption; impl AuthenticatedEncryption { #[cfg(not(target_os = "solana"))] - #[allow(clippy::new_ret_no_self)] fn keygen(rng: &mut T) -> AeKey { AeKey(rng.gen::<[u8; 16]>()) } diff --git a/zk-token-sdk/src/encryption/elgamal.rs b/zk-token-sdk/src/encryption/elgamal.rs index 877e775c5a..e9e6e1f55b 100644 --- a/zk-token-sdk/src/encryption/elgamal.rs +++ b/zk-token-sdk/src/encryption/elgamal.rs @@ -177,7 +177,6 @@ impl ElGamalKeypair { /// /// This function is randomized. It internally samples a scalar element using `OsRng`. #[cfg(not(target_os = "solana"))] - #[allow(clippy::new_ret_no_self)] pub fn new_rand() -> Self { ElGamal::keygen() }