From 04964c315bc44b5f4c167b97af370e86d4f693bc Mon Sep 17 00:00:00 2001 From: yihau Date: Fri, 25 Apr 2025 23:36:22 +0800 Subject: [PATCH 1/4] clippy: allow result_large_err in some places --- bench-tps/src/lib.rs | 1 + cli/src/lib.rs | 2 ++ client/src/send_and_confirm_transactions_in_parallel.rs | 1 + client/src/tpu_client.rs | 1 + local-cluster/src/lib.rs | 1 + pubsub-client/src/pubsub_client.rs | 2 ++ rpc-client/src/nonblocking/rpc_client.rs | 2 ++ rpc-client/src/rpc_client.rs | 2 ++ rpc-test/tests/rpc.rs | 2 ++ stake-accounts/src/main.rs | 2 ++ storage-bigtable/src/lib.rs | 1 + svm/examples/json-rpc/client/src/client.rs | 1 + svm/examples/json-rpc/client/src/utils.rs | 2 ++ tokens/src/lib.rs | 1 + tokens/src/spl_token.rs | 1 + tps-client/src/lib.rs | 1 + tpu-client/src/tpu_client.rs | 2 ++ validator/src/lib.rs | 1 + vortexor/src/stake_updater.rs | 2 ++ watchtower/src/main.rs | 1 + 20 files changed, 29 insertions(+) diff --git a/bench-tps/src/lib.rs b/bench-tps/src/lib.rs index 1c11471b378..2485948c16b 100644 --- a/bench-tps/src/lib.rs +++ b/bench-tps/src/lib.rs @@ -1,4 +1,5 @@ #![allow(clippy::arithmetic_side_effects)] +#![allow(clippy::result_large_err)] pub mod bench; pub mod cli; pub mod keypairs; diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 7e7d89749f8..130fbbf2f72 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(clippy::result_large_err)] + macro_rules! ACCOUNT_STRING { () => { r#" Address is one of: diff --git a/client/src/send_and_confirm_transactions_in_parallel.rs b/client/src/send_and_confirm_transactions_in_parallel.rs index 6d357180ef6..249e4807421 100644 --- a/client/src/send_and_confirm_transactions_in_parallel.rs +++ b/client/src/send_and_confirm_transactions_in_parallel.rs @@ -1,3 +1,4 @@ +#![allow(clippy::result_large_err)] use { crate::{ nonblocking::{rpc_client::RpcClient, tpu_client::TpuClient}, diff --git a/client/src/tpu_client.rs b/client/src/tpu_client.rs index 695138f7234..a9fbe7da54f 100644 --- a/client/src/tpu_client.rs +++ b/client/src/tpu_client.rs @@ -1,3 +1,4 @@ +#![allow(clippy::result_large_err)] use { crate::connection_cache::ConnectionCache, solana_connection_cache::connection_cache::{ diff --git a/local-cluster/src/lib.rs b/local-cluster/src/lib.rs index 6a5b0c70327..961ad0d8275 100644 --- a/local-cluster/src/lib.rs +++ b/local-cluster/src/lib.rs @@ -1,4 +1,5 @@ #![allow(clippy::arithmetic_side_effects)] +#![allow(clippy::result_large_err)] pub mod cluster; pub mod cluster_tests; pub mod integration_tests; diff --git a/pubsub-client/src/pubsub_client.rs b/pubsub-client/src/pubsub_client.rs index a5e05f6ca8b..c44786ff73c 100644 --- a/pubsub-client/src/pubsub_client.rs +++ b/pubsub-client/src/pubsub_client.rs @@ -1,3 +1,5 @@ +#![allow(clippy::result_large_err)] + //! A client for subscribing to messages from the RPC server. //! //! The [`PubsubClient`] implements [Solana WebSocket event diff --git a/rpc-client/src/nonblocking/rpc_client.rs b/rpc-client/src/nonblocking/rpc_client.rs index 73451f76ae9..6166ea442ad 100644 --- a/rpc-client/src/nonblocking/rpc_client.rs +++ b/rpc-client/src/nonblocking/rpc_client.rs @@ -1,3 +1,5 @@ +#![allow(clippy::result_large_err)] + //! Communication with a Solana node over RPC asynchronously . //! //! Software that interacts with the Solana blockchain, whether querying its diff --git a/rpc-client/src/rpc_client.rs b/rpc-client/src/rpc_client.rs index fad544ed4c4..8b76fa2bade 100644 --- a/rpc-client/src/rpc_client.rs +++ b/rpc-client/src/rpc_client.rs @@ -1,3 +1,5 @@ +#![allow(clippy::result_large_err)] + //! Communication with a Solana node over RPC. //! //! Software that interacts with the Solana blockchain, whether querying its diff --git a/rpc-test/tests/rpc.rs b/rpc-test/tests/rpc.rs index df3e5840dff..739ccff64f3 100644 --- a/rpc-test/tests/rpc.rs +++ b/rpc-test/tests/rpc.rs @@ -1,3 +1,5 @@ +#![allow(clippy::result_large_err)] + use { bincode::serialize, crossbeam_channel::unbounded, diff --git a/stake-accounts/src/main.rs b/stake-accounts/src/main.rs index c931e7423b9..8b45772c130 100644 --- a/stake-accounts/src/main.rs +++ b/stake-accounts/src/main.rs @@ -1,4 +1,6 @@ #![allow(clippy::arithmetic_side_effects)] +#![allow(clippy::result_large_err)] + mod arg_parser; mod args; mod stake_accounts; diff --git a/storage-bigtable/src/lib.rs b/storage-bigtable/src/lib.rs index 8731f998657..91e2a460801 100644 --- a/storage-bigtable/src/lib.rs +++ b/storage-bigtable/src/lib.rs @@ -1,4 +1,5 @@ #![allow(clippy::arithmetic_side_effects)] +#![allow(clippy::result_large_err)] use { crate::bigtable::RowKey, diff --git a/svm/examples/json-rpc/client/src/client.rs b/svm/examples/json-rpc/client/src/client.rs index 4f9b7fe9e12..ad6cfc3c1ef 100644 --- a/svm/examples/json-rpc/client/src/client.rs +++ b/svm/examples/json-rpc/client/src/client.rs @@ -1,3 +1,4 @@ +#![allow(clippy::result_large_err)] use { crate::utils, solana_client::rpc_client::RpcClient, diff --git a/svm/examples/json-rpc/client/src/utils.rs b/svm/examples/json-rpc/client/src/utils.rs index 240d0530e7e..94eb11d7a8c 100644 --- a/svm/examples/json-rpc/client/src/utils.rs +++ b/svm/examples/json-rpc/client/src/utils.rs @@ -1,3 +1,5 @@ +#![allow(clippy::result_large_err)] + use { borsh::{BorshDeserialize, BorshSerialize}, solana_sdk::{ diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs index 2e1e4641bcb..65b1b0017ac 100644 --- a/tokens/src/lib.rs +++ b/tokens/src/lib.rs @@ -1,4 +1,5 @@ #![allow(clippy::arithmetic_side_effects)] +#![allow(clippy::result_large_err)] pub mod arg_parser; pub mod args; pub mod commands; diff --git a/tokens/src/spl_token.rs b/tokens/src/spl_token.rs index 3e998c1a124..5e2fd530706 100644 --- a/tokens/src/spl_token.rs +++ b/tokens/src/spl_token.rs @@ -1,3 +1,4 @@ +#![allow(clippy::result_large_err)] use { crate::{ args::{DistributeTokensArgs, SplTokenArgs}, diff --git a/tps-client/src/lib.rs b/tps-client/src/lib.rs index d145f309f57..ec99d235560 100644 --- a/tps-client/src/lib.rs +++ b/tps-client/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(clippy::result_large_err)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] use { log::debug, diff --git a/tpu-client/src/tpu_client.rs b/tpu-client/src/tpu_client.rs index 12fc59883dd..19a6480cdc9 100644 --- a/tpu-client/src/tpu_client.rs +++ b/tpu-client/src/tpu_client.rs @@ -1,3 +1,5 @@ +#![allow(clippy::result_large_err)] + pub use crate::nonblocking::tpu_client::TpuSenderError; use { crate::nonblocking::tpu_client::TpuClient as NonblockingTpuClient, diff --git a/validator/src/lib.rs b/validator/src/lib.rs index 04a03964da6..f4cb9508a61 100644 --- a/validator/src/lib.rs +++ b/validator/src/lib.rs @@ -1,4 +1,5 @@ #![allow(clippy::arithmetic_side_effects)] +#![allow(clippy::result_large_err)] pub use solana_test_validator as test_validator; use { console::style, diff --git a/vortexor/src/stake_updater.rs b/vortexor/src/stake_updater.rs index 8967cf12524..48fad14cb5b 100644 --- a/vortexor/src/stake_updater.rs +++ b/vortexor/src/stake_updater.rs @@ -1,3 +1,5 @@ +#![allow(clippy::result_large_err)] + //! Module responsible for updating the staked key map. //! Adapted from jito-relayer code. diff --git a/watchtower/src/main.rs b/watchtower/src/main.rs index e4ae9495555..8498ca05a65 100644 --- a/watchtower/src/main.rs +++ b/watchtower/src/main.rs @@ -1,5 +1,6 @@ //! A command-line executable for monitoring the health of a cluster #![allow(clippy::arithmetic_side_effects)] +#![allow(clippy::result_large_err)] use { clap::{crate_description, crate_name, value_t, value_t_or_exit, values_t, App, Arg}, From 9510492b40dc74128e7bab1f368d60e186cb34b2 Mon Sep 17 00:00:00 2001 From: yihau Date: Sat, 26 Apr 2025 00:07:47 +0800 Subject: [PATCH 2/4] Revert "clippy: allow result_large_err in some places" This reverts commit 04964c315bc44b5f4c167b97af370e86d4f693bc. --- bench-tps/src/lib.rs | 1 - cli/src/lib.rs | 2 -- client/src/send_and_confirm_transactions_in_parallel.rs | 1 - client/src/tpu_client.rs | 1 - local-cluster/src/lib.rs | 1 - pubsub-client/src/pubsub_client.rs | 2 -- rpc-client/src/nonblocking/rpc_client.rs | 2 -- rpc-client/src/rpc_client.rs | 2 -- rpc-test/tests/rpc.rs | 2 -- stake-accounts/src/main.rs | 2 -- storage-bigtable/src/lib.rs | 1 - svm/examples/json-rpc/client/src/client.rs | 1 - svm/examples/json-rpc/client/src/utils.rs | 2 -- tokens/src/lib.rs | 1 - tokens/src/spl_token.rs | 1 - tps-client/src/lib.rs | 1 - tpu-client/src/tpu_client.rs | 2 -- validator/src/lib.rs | 1 - vortexor/src/stake_updater.rs | 2 -- watchtower/src/main.rs | 1 - 20 files changed, 29 deletions(-) diff --git a/bench-tps/src/lib.rs b/bench-tps/src/lib.rs index 2485948c16b..1c11471b378 100644 --- a/bench-tps/src/lib.rs +++ b/bench-tps/src/lib.rs @@ -1,5 +1,4 @@ #![allow(clippy::arithmetic_side_effects)] -#![allow(clippy::result_large_err)] pub mod bench; pub mod cli; pub mod keypairs; diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 130fbbf2f72..7e7d89749f8 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1,5 +1,3 @@ -#![allow(clippy::result_large_err)] - macro_rules! ACCOUNT_STRING { () => { r#" Address is one of: diff --git a/client/src/send_and_confirm_transactions_in_parallel.rs b/client/src/send_and_confirm_transactions_in_parallel.rs index 249e4807421..6d357180ef6 100644 --- a/client/src/send_and_confirm_transactions_in_parallel.rs +++ b/client/src/send_and_confirm_transactions_in_parallel.rs @@ -1,4 +1,3 @@ -#![allow(clippy::result_large_err)] use { crate::{ nonblocking::{rpc_client::RpcClient, tpu_client::TpuClient}, diff --git a/client/src/tpu_client.rs b/client/src/tpu_client.rs index a9fbe7da54f..695138f7234 100644 --- a/client/src/tpu_client.rs +++ b/client/src/tpu_client.rs @@ -1,4 +1,3 @@ -#![allow(clippy::result_large_err)] use { crate::connection_cache::ConnectionCache, solana_connection_cache::connection_cache::{ diff --git a/local-cluster/src/lib.rs b/local-cluster/src/lib.rs index 961ad0d8275..6a5b0c70327 100644 --- a/local-cluster/src/lib.rs +++ b/local-cluster/src/lib.rs @@ -1,5 +1,4 @@ #![allow(clippy::arithmetic_side_effects)] -#![allow(clippy::result_large_err)] pub mod cluster; pub mod cluster_tests; pub mod integration_tests; diff --git a/pubsub-client/src/pubsub_client.rs b/pubsub-client/src/pubsub_client.rs index c44786ff73c..a5e05f6ca8b 100644 --- a/pubsub-client/src/pubsub_client.rs +++ b/pubsub-client/src/pubsub_client.rs @@ -1,5 +1,3 @@ -#![allow(clippy::result_large_err)] - //! A client for subscribing to messages from the RPC server. //! //! The [`PubsubClient`] implements [Solana WebSocket event diff --git a/rpc-client/src/nonblocking/rpc_client.rs b/rpc-client/src/nonblocking/rpc_client.rs index 6166ea442ad..73451f76ae9 100644 --- a/rpc-client/src/nonblocking/rpc_client.rs +++ b/rpc-client/src/nonblocking/rpc_client.rs @@ -1,5 +1,3 @@ -#![allow(clippy::result_large_err)] - //! Communication with a Solana node over RPC asynchronously . //! //! Software that interacts with the Solana blockchain, whether querying its diff --git a/rpc-client/src/rpc_client.rs b/rpc-client/src/rpc_client.rs index 8b76fa2bade..fad544ed4c4 100644 --- a/rpc-client/src/rpc_client.rs +++ b/rpc-client/src/rpc_client.rs @@ -1,5 +1,3 @@ -#![allow(clippy::result_large_err)] - //! Communication with a Solana node over RPC. //! //! Software that interacts with the Solana blockchain, whether querying its diff --git a/rpc-test/tests/rpc.rs b/rpc-test/tests/rpc.rs index 739ccff64f3..df3e5840dff 100644 --- a/rpc-test/tests/rpc.rs +++ b/rpc-test/tests/rpc.rs @@ -1,5 +1,3 @@ -#![allow(clippy::result_large_err)] - use { bincode::serialize, crossbeam_channel::unbounded, diff --git a/stake-accounts/src/main.rs b/stake-accounts/src/main.rs index 8b45772c130..c931e7423b9 100644 --- a/stake-accounts/src/main.rs +++ b/stake-accounts/src/main.rs @@ -1,6 +1,4 @@ #![allow(clippy::arithmetic_side_effects)] -#![allow(clippy::result_large_err)] - mod arg_parser; mod args; mod stake_accounts; diff --git a/storage-bigtable/src/lib.rs b/storage-bigtable/src/lib.rs index 91e2a460801..8731f998657 100644 --- a/storage-bigtable/src/lib.rs +++ b/storage-bigtable/src/lib.rs @@ -1,5 +1,4 @@ #![allow(clippy::arithmetic_side_effects)] -#![allow(clippy::result_large_err)] use { crate::bigtable::RowKey, diff --git a/svm/examples/json-rpc/client/src/client.rs b/svm/examples/json-rpc/client/src/client.rs index ad6cfc3c1ef..4f9b7fe9e12 100644 --- a/svm/examples/json-rpc/client/src/client.rs +++ b/svm/examples/json-rpc/client/src/client.rs @@ -1,4 +1,3 @@ -#![allow(clippy::result_large_err)] use { crate::utils, solana_client::rpc_client::RpcClient, diff --git a/svm/examples/json-rpc/client/src/utils.rs b/svm/examples/json-rpc/client/src/utils.rs index 94eb11d7a8c..240d0530e7e 100644 --- a/svm/examples/json-rpc/client/src/utils.rs +++ b/svm/examples/json-rpc/client/src/utils.rs @@ -1,5 +1,3 @@ -#![allow(clippy::result_large_err)] - use { borsh::{BorshDeserialize, BorshSerialize}, solana_sdk::{ diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs index 65b1b0017ac..2e1e4641bcb 100644 --- a/tokens/src/lib.rs +++ b/tokens/src/lib.rs @@ -1,5 +1,4 @@ #![allow(clippy::arithmetic_side_effects)] -#![allow(clippy::result_large_err)] pub mod arg_parser; pub mod args; pub mod commands; diff --git a/tokens/src/spl_token.rs b/tokens/src/spl_token.rs index 5e2fd530706..3e998c1a124 100644 --- a/tokens/src/spl_token.rs +++ b/tokens/src/spl_token.rs @@ -1,4 +1,3 @@ -#![allow(clippy::result_large_err)] use { crate::{ args::{DistributeTokensArgs, SplTokenArgs}, diff --git a/tps-client/src/lib.rs b/tps-client/src/lib.rs index ec99d235560..d145f309f57 100644 --- a/tps-client/src/lib.rs +++ b/tps-client/src/lib.rs @@ -1,4 +1,3 @@ -#![allow(clippy::result_large_err)] #![cfg_attr(docsrs, feature(doc_auto_cfg))] use { log::debug, diff --git a/tpu-client/src/tpu_client.rs b/tpu-client/src/tpu_client.rs index 19a6480cdc9..12fc59883dd 100644 --- a/tpu-client/src/tpu_client.rs +++ b/tpu-client/src/tpu_client.rs @@ -1,5 +1,3 @@ -#![allow(clippy::result_large_err)] - pub use crate::nonblocking::tpu_client::TpuSenderError; use { crate::nonblocking::tpu_client::TpuClient as NonblockingTpuClient, diff --git a/validator/src/lib.rs b/validator/src/lib.rs index f4cb9508a61..04a03964da6 100644 --- a/validator/src/lib.rs +++ b/validator/src/lib.rs @@ -1,5 +1,4 @@ #![allow(clippy::arithmetic_side_effects)] -#![allow(clippy::result_large_err)] pub use solana_test_validator as test_validator; use { console::style, diff --git a/vortexor/src/stake_updater.rs b/vortexor/src/stake_updater.rs index 48fad14cb5b..8967cf12524 100644 --- a/vortexor/src/stake_updater.rs +++ b/vortexor/src/stake_updater.rs @@ -1,5 +1,3 @@ -#![allow(clippy::result_large_err)] - //! Module responsible for updating the staked key map. //! Adapted from jito-relayer code. diff --git a/watchtower/src/main.rs b/watchtower/src/main.rs index 8498ca05a65..e4ae9495555 100644 --- a/watchtower/src/main.rs +++ b/watchtower/src/main.rs @@ -1,6 +1,5 @@ //! A command-line executable for monitoring the health of a cluster #![allow(clippy::arithmetic_side_effects)] -#![allow(clippy::result_large_err)] use { clap::{crate_description, crate_name, value_t, value_t_or_exit, values_t, App, Arg}, From a611b41bc57d174e7998384f7e904b3e0de4fd39 Mon Sep 17 00:00:00 2001 From: yihau Date: Mon, 28 Apr 2025 12:18:28 +0800 Subject: [PATCH 3/4] allow --- bench-tps/src/lib.rs | 1 + cli/src/lib.rs | 1 + .../src/send_and_confirm_transactions_in_parallel.rs | 2 ++ client/src/tpu_client.rs | 2 ++ local-cluster/src/lib.rs | 1 + pubsub-client/src/pubsub_client.rs | 3 +++ rpc-client/src/nonblocking/rpc_client.rs | 2 ++ rpc-client/src/rpc_client.rs | 2 ++ rpc-test/tests/rpc.rs | 2 ++ stake-accounts/src/main.rs | 12 ++++++++++++ storage-bigtable/src/bigtable.rs | 4 ++++ storage-bigtable/src/lib.rs | 1 + svm/examples/json-rpc/client/src/client.rs | 3 +++ svm/examples/json-rpc/client/src/utils.rs | 4 ++++ tokens/src/lib.rs | 1 + tps-client/src/lib.rs | 1 + tpu-client/src/tpu_client.rs | 1 + validator/src/dashboard.rs | 1 + vortexor/src/stake_updater.rs | 1 + watchtower/src/main.rs | 2 ++ 20 files changed, 47 insertions(+) diff --git a/bench-tps/src/lib.rs b/bench-tps/src/lib.rs index 1c11471b378..2485948c16b 100644 --- a/bench-tps/src/lib.rs +++ b/bench-tps/src/lib.rs @@ -1,4 +1,5 @@ #![allow(clippy::arithmetic_side_effects)] +#![allow(clippy::result_large_err)] pub mod bench; pub mod cli; pub mod keypairs; diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 7e7d89749f8..92be2e89991 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(clippy::result_large_err)] macro_rules! ACCOUNT_STRING { () => { r#" Address is one of: diff --git a/client/src/send_and_confirm_transactions_in_parallel.rs b/client/src/send_and_confirm_transactions_in_parallel.rs index 6d357180ef6..86c85f525b6 100644 --- a/client/src/send_and_confirm_transactions_in_parallel.rs +++ b/client/src/send_and_confirm_transactions_in_parallel.rs @@ -103,6 +103,7 @@ pub async fn send_and_confirm_transactions_in_parallel( since = "2.2.0", note = "Use send_and_confirm_transactions_in_parallel_blocking_v2" )] +#[allow(clippy::result_large_err)] pub fn send_and_confirm_transactions_in_parallel_blocking( rpc_client: Arc, tpu_client: Option, @@ -123,6 +124,7 @@ pub fn send_and_confirm_transactions_in_parallel_blocking( } /// Sends and confirms transactions concurrently in a sync context +#[allow(clippy::result_large_err)] pub fn send_and_confirm_transactions_in_parallel_blocking_v2( rpc_client: Arc, tpu_client: Option, diff --git a/client/src/tpu_client.rs b/client/src/tpu_client.rs index 695138f7234..c8846671f98 100644 --- a/client/src/tpu_client.rs +++ b/client/src/tpu_client.rs @@ -73,6 +73,7 @@ where } } +#[allow(clippy::result_large_err)] impl TpuClient { /// Create a new client that disconnects when dropped pub fn new( @@ -92,6 +93,7 @@ impl TpuClient { } } +#[allow(clippy::result_large_err)] impl TpuClient where P: ConnectionPool, diff --git a/local-cluster/src/lib.rs b/local-cluster/src/lib.rs index 6a5b0c70327..961ad0d8275 100644 --- a/local-cluster/src/lib.rs +++ b/local-cluster/src/lib.rs @@ -1,4 +1,5 @@ #![allow(clippy::arithmetic_side_effects)] +#![allow(clippy::result_large_err)] pub mod cluster; pub mod cluster_tests; pub mod integration_tests; diff --git a/pubsub-client/src/pubsub_client.rs b/pubsub-client/src/pubsub_client.rs index a5e05f6ca8b..f46ab97d07f 100644 --- a/pubsub-client/src/pubsub_client.rs +++ b/pubsub-client/src/pubsub_client.rs @@ -157,6 +157,7 @@ where } } +#[allow(clippy::result_large_err)] impl PubsubClientSubscription where T: DeserializeOwned, @@ -298,6 +299,7 @@ pub type RootSubscription = (PubsubRootClientSubscription, Receiver); /// See the [module documentation][self]. pub struct PubsubClient {} +#[allow(clippy::result_large_err)] fn connect_with_retry( url: Url, ) -> Result>, tungstenite::Error> { @@ -331,6 +333,7 @@ fn connect_with_retry( } } +#[allow(clippy::result_large_err)] impl PubsubClient { /// Subscribe to account events. /// diff --git a/rpc-client/src/nonblocking/rpc_client.rs b/rpc-client/src/nonblocking/rpc_client.rs index 73451f76ae9..eb53782da24 100644 --- a/rpc-client/src/nonblocking/rpc_client.rs +++ b/rpc-client/src/nonblocking/rpc_client.rs @@ -4653,6 +4653,7 @@ impl RpcClient { } } +#[allow(clippy::result_large_err)] fn serialize_and_encode(input: &T, encoding: UiTransactionEncoding) -> ClientResult where T: serde::ser::Serialize, @@ -4680,6 +4681,7 @@ pub(crate) fn get_rpc_request_str(rpc_addr: SocketAddr, tls: bool) -> String { } } +#[allow(clippy::result_large_err)] pub(crate) fn parse_keyed_accounts( accounts: Vec, request: RpcRequest, diff --git a/rpc-client/src/rpc_client.rs b/rpc-client/src/rpc_client.rs index fad544ed4c4..4b5f09bf0f2 100644 --- a/rpc-client/src/rpc_client.rs +++ b/rpc-client/src/rpc_client.rs @@ -198,6 +198,7 @@ impl Drop for RpcClient { } } +#[allow(clippy::result_large_err)] impl RpcClient { /// Create an `RpcClient` from an [`RpcSender`] and an [`RpcClientConfig`]. /// @@ -3882,6 +3883,7 @@ mod tests { // Regression test that the get_block_production_with_config // method internally creates the json params array correctly. #[test] + #[allow(clippy::result_large_err)] fn get_block_production_with_config_no_error() -> ClientResult<()> { let rpc_client = RpcClient::new_mock("succeeds".to_string()); diff --git a/rpc-test/tests/rpc.rs b/rpc-test/tests/rpc.rs index df3e5840dff..52a5a472155 100644 --- a/rpc-test/tests/rpc.rs +++ b/rpc-test/tests/rpc.rs @@ -137,6 +137,7 @@ fn test_rpc_send_tx() { } #[test] +#[allow(clippy::result_large_err)] fn test_simulation_replaced_blockhash() -> ClientResult<()> { solana_logger::setup(); @@ -552,6 +553,7 @@ fn test_tpu_send_transaction_with_quic() { } #[test] +#[allow(clippy::result_large_err)] fn deserialize_rpc_error() -> ClientResult<()> { solana_logger::setup(); diff --git a/stake-accounts/src/main.rs b/stake-accounts/src/main.rs index c931e7423b9..1273c650b1f 100644 --- a/stake-accounts/src/main.rs +++ b/stake-accounts/src/main.rs @@ -26,12 +26,14 @@ use { std::{env, error::Error}, }; +#[allow(clippy::result_large_err)] fn get_balance_at(client: &RpcClient, pubkey: &Pubkey, i: usize) -> Result { let address = stake_accounts::derive_stake_account_address(pubkey, i); client.get_balance(&address) } // Return the number of derived stake accounts with balances +#[allow(clippy::result_large_err)] fn count_stake_accounts(client: &RpcClient, base_pubkey: &Pubkey) -> Result { let mut i = 0; while get_balance_at(client, base_pubkey, i)? > 0 { @@ -40,6 +42,7 @@ fn count_stake_accounts(client: &RpcClient, base_pubkey: &Pubkey) -> Result, @@ -50,12 +53,14 @@ fn get_balances( .collect() } +#[allow(clippy::result_large_err)] fn get_lockup(client: &RpcClient, address: &Pubkey) -> Result { client .get_account(address) .map(|account| stake_state::lockup_from(&account).unwrap()) } +#[allow(clippy::result_large_err)] fn get_lockups( client: &RpcClient, addresses: Vec, @@ -66,6 +71,7 @@ fn get_lockups( .collect() } +#[allow(clippy::result_large_err)] fn process_new_stake_account( client: &RpcClient, args: &NewArgs>, @@ -89,6 +95,7 @@ fn process_new_stake_account( Ok(signature) } +#[allow(clippy::result_large_err)] fn process_authorize_stake_accounts( client: &RpcClient, args: &AuthorizeArgs>, @@ -111,6 +118,7 @@ fn process_authorize_stake_accounts( Ok(()) } +#[allow(clippy::result_large_err)] fn process_lockup_stake_accounts( client: &RpcClient, args: &SetLockupArgs>, @@ -140,6 +148,7 @@ fn process_lockup_stake_accounts( Ok(()) } +#[allow(clippy::result_large_err)] fn process_rebase_stake_accounts( client: &RpcClient, args: &RebaseArgs>, @@ -167,6 +176,7 @@ fn process_rebase_stake_accounts( Ok(()) } +#[allow(clippy::result_large_err)] fn process_move_stake_accounts( client: &RpcClient, move_args: &MoveArgs>, @@ -200,6 +210,7 @@ fn process_move_stake_accounts( Ok(()) } +#[allow(clippy::result_large_err)] fn send_and_confirm_message( client: &RpcClient, message: Message, @@ -218,6 +229,7 @@ fn send_and_confirm_message( } } +#[allow(clippy::result_large_err)] fn send_and_confirm_messages( client: &RpcClient, messages: Vec, diff --git a/storage-bigtable/src/bigtable.rs b/storage-bigtable/src/bigtable.rs index ec1c117b44f..b91a8d72cf3 100644 --- a/storage-bigtable/src/bigtable.rs +++ b/storage-bigtable/src/bigtable.rs @@ -124,6 +124,7 @@ pub struct BigTableConnection { max_message_size: usize, } +#[allow(clippy::result_large_err)] impl BigTableConnection { /// Establish a connection to the BigTable instance named `instance_name`. If read-only access /// is required, the `read_only` flag should be used to reduce the requested OAuth2 scope. @@ -899,6 +900,7 @@ impl) -> InterceptedRequestResult> BigTable { } } +#[allow(clippy::result_large_err)] pub(crate) fn deserialize_protobuf_or_bincode_cell_data( row_data: RowDataSlice, table: &str, @@ -918,6 +920,7 @@ where deserialize_bincode_cell_data(row_data, table, key).map(CellData::Bincode) } +#[allow(clippy::result_large_err)] pub(crate) fn deserialize_protobuf_cell_data( row_data: RowDataSlice, table: &str, @@ -939,6 +942,7 @@ where }) } +#[allow(clippy::result_large_err)] pub(crate) fn deserialize_bincode_cell_data( row_data: RowDataSlice, table: &str, diff --git a/storage-bigtable/src/lib.rs b/storage-bigtable/src/lib.rs index 8731f998657..3d81b677380 100644 --- a/storage-bigtable/src/lib.rs +++ b/storage-bigtable/src/lib.rs @@ -463,6 +463,7 @@ impl LedgerStorage { .await } + #[allow(clippy::result_large_err)] pub fn new_for_emulator( instance_name: &str, app_profile_id: &str, diff --git a/svm/examples/json-rpc/client/src/client.rs b/svm/examples/json-rpc/client/src/client.rs index 4f9b7fe9e12..178214626f0 100644 --- a/svm/examples/json-rpc/client/src/client.rs +++ b/svm/examples/json-rpc/client/src/client.rs @@ -13,6 +13,7 @@ use { /// Establishes a RPC connection with the Simulation server. /// Information about the server is gleened from the config file `config.yml`. +#[allow(clippy::result_large_err)] pub fn establish_connection(url: &Option<&str>, config: &Option<&str>) -> utils::Result { let rpc_url = match url { Some(x) => { @@ -35,6 +36,7 @@ pub fn establish_connection(url: &Option<&str>, config: &Option<&str>) -> utils: /// to an executable account via CONNECTION. Failure to read the /// keypair or the loaded keypair corresponding to an executable /// account will result in an error being returned. +#[allow(clippy::result_large_err)] pub fn get_program(keypair_path: &str, connection: &RpcClient) -> utils::Result { let program_keypair = read_keypair_file(keypair_path).map_err(|e| { utils::Error::InvalidConfig(format!( @@ -54,6 +56,7 @@ pub fn get_program(keypair_path: &str, connection: &RpcClient) -> utils::Result< Ok(program_keypair) } +#[allow(clippy::result_large_err)] pub fn say_hello(player: &Keypair, program: &Keypair, connection: &RpcClient) -> utils::Result<()> { let greeting_pubkey = utils::get_greeting_public_key(&player.pubkey(), &program.pubkey())?; println!("greeting pubkey {greeting_pubkey:?}"); diff --git a/svm/examples/json-rpc/client/src/utils.rs b/svm/examples/json-rpc/client/src/utils.rs index 240d0530e7e..1a40b5385f2 100644 --- a/svm/examples/json-rpc/client/src/utils.rs +++ b/svm/examples/json-rpc/client/src/utils.rs @@ -35,6 +35,7 @@ struct GreetingSchema { } /// Parses and returns the Solana yaml config on the system. +#[allow(clippy::result_large_err)] pub fn get_config(config: &Option<&str>) -> Result { let path = match config { Some(path) => std::path::PathBuf::from(path), @@ -64,6 +65,7 @@ pub fn get_config(config: &Option<&str>) -> Result { /// Gets the RPC url for the cluster that this machine is configured /// to communicate with. +#[allow(clippy::result_large_err)] pub fn get_rpc_url(config: &Option<&str>) -> Result { let config = get_config(config)?; match config["json_rpc_url"].as_str() { @@ -76,6 +78,7 @@ pub fn get_rpc_url(config: &Option<&str>) -> Result { /// Gets the "player" or local solana wallet that has been configured /// on the machine. +#[allow(clippy::result_large_err)] pub fn get_player(config: &Option<&str>) -> Result { let config = get_config(config)?; if let Some(path) = config["keypair_path"].as_str() { @@ -98,6 +101,7 @@ pub fn get_greeting_seed() -> &'static str { /// Derives and returns the greeting account public key for a given /// PLAYER, PROGRAM combination. +#[allow(clippy::result_large_err)] pub fn get_greeting_public_key(player: &Pubkey, program: &Pubkey) -> Result { Ok(Pubkey::create_with_seed( player, diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs index 2e1e4641bcb..65b1b0017ac 100644 --- a/tokens/src/lib.rs +++ b/tokens/src/lib.rs @@ -1,4 +1,5 @@ #![allow(clippy::arithmetic_side_effects)] +#![allow(clippy::result_large_err)] pub mod arg_parser; pub mod args; pub mod commands; diff --git a/tps-client/src/lib.rs b/tps-client/src/lib.rs index d145f309f57..3c7aef90d76 100644 --- a/tps-client/src/lib.rs +++ b/tps-client/src/lib.rs @@ -39,6 +39,7 @@ pub enum TpsClientError { pub type TpsClientResult = std::result::Result; +#[allow(clippy::result_large_err)] pub trait TpsClient { /// Send a signed transaction without confirmation fn send_transaction(&self, transaction: Transaction) -> TpsClientResult; diff --git a/tpu-client/src/tpu_client.rs b/tpu-client/src/tpu_client.rs index 12fc59883dd..5f895ca5b6d 100644 --- a/tpu-client/src/tpu_client.rs +++ b/tpu-client/src/tpu_client.rs @@ -80,6 +80,7 @@ pub struct TpuClient< tpu_client: Arc>, } +#[allow(clippy::result_large_err)] impl TpuClient where P: ConnectionPool, diff --git a/validator/src/dashboard.rs b/validator/src/dashboard.rs index 535b7d7d7bc..664cdaec387 100644 --- a/validator/src/dashboard.rs +++ b/validator/src/dashboard.rs @@ -254,6 +254,7 @@ fn get_contact_info(rpc_client: &RpcClient, identity: &Pubkey) -> Option, shared_staked_nodes: &Arc>, diff --git a/watchtower/src/main.rs b/watchtower/src/main.rs index e4ae9495555..aa1f7f0b2dc 100644 --- a/watchtower/src/main.rs +++ b/watchtower/src/main.rs @@ -244,6 +244,7 @@ fn get_config() -> Config { config } +#[allow(clippy::result_large_err)] fn get_cluster_info( config: &Config, rpc_client: &RpcClient, @@ -274,6 +275,7 @@ struct EndpointData { last_recent_blockhash: Hash, } +#[allow(clippy::result_large_err)] fn query_endpoint( config: &Config, endpoint: &mut EndpointData, From 46d7629b6d4238c75e5689c708dbe25c8c6f96e3 Mon Sep 17 00:00:00 2001 From: yihau Date: Wed, 30 Apr 2025 22:47:45 +0800 Subject: [PATCH 4/4] don't use crate-wide allow --- bench-tps/src/bench.rs | 2 ++ bench-tps/src/lib.rs | 1 - bench-tps/src/rpc_with_retry_utils.rs | 3 +++ cli/src/address_lookup_table.rs | 1 + cli/src/checks.rs | 10 ++++++++++ cli/src/cli.rs | 1 + cli/src/cluster_query.rs | 19 +++++++++++++++++++ cli/src/feature.rs | 5 +++++ cli/src/inflation.rs | 1 + cli/src/lib.rs | 1 - cli/src/nonce.rs | 8 ++++++++ cli/src/program.rs | 1 + cli/src/program_v4.rs | 1 + cli/src/spend_utils.rs | 3 +++ cli/src/stake.rs | 13 +++++++++++++ cli/src/validator_info.rs | 2 ++ cli/src/vote.rs | 7 +++++++ cli/src/wallet.rs | 9 +++++++++ local-cluster/src/cluster_tests.rs | 1 + local-cluster/src/lib.rs | 1 - tokens/src/commands.rs | 13 +++++++++++++ tokens/src/lib.rs | 1 - tokens/src/spl_token.rs | 4 ++++ tokens/src/stake.rs | 1 + 24 files changed, 105 insertions(+), 4 deletions(-) diff --git a/bench-tps/src/bench.rs b/bench-tps/src/bench.rs index c66c4ebada1..23a02fa10a7 100644 --- a/bench-tps/src/bench.rs +++ b/bench-tps/src/bench.rs @@ -1111,6 +1111,7 @@ fn compute_and_report_stats( ); } +#[allow(clippy::result_large_err)] pub fn generate_and_fund_keypairs( client: Arc, funding_key: &Keypair, @@ -1140,6 +1141,7 @@ pub fn generate_and_fund_keypairs Ok(keypairs) } +#[allow(clippy::result_large_err)] pub fn fund_keypairs( client: Arc, funding_key: &Keypair, diff --git a/bench-tps/src/lib.rs b/bench-tps/src/lib.rs index 2485948c16b..1c11471b378 100644 --- a/bench-tps/src/lib.rs +++ b/bench-tps/src/lib.rs @@ -1,5 +1,4 @@ #![allow(clippy::arithmetic_side_effects)] -#![allow(clippy::result_large_err)] pub mod bench; pub mod cli; pub mod keypairs; diff --git a/bench-tps/src/rpc_with_retry_utils.rs b/bench-tps/src/rpc_with_retry_utils.rs index 18f0d27dc64..af47ca56192 100644 --- a/bench-tps/src/rpc_with_retry_utils.rs +++ b/bench-tps/src/rpc_with_retry_utils.rs @@ -10,6 +10,7 @@ use { const NUM_RETRY: u64 = 5; const RETRY_EVERY_MS: u64 = 4 * DEFAULT_MS_PER_SLOT; +#[allow(clippy::result_large_err)] fn call_rpc_with_retry(f: Func, retry_warning: &str) -> TpsClientResult where Func: Fn() -> TpsClientResult, @@ -32,6 +33,7 @@ where } } +#[allow(clippy::result_large_err)] pub(crate) fn get_slot_with_retry( client: &Arc, commitment: CommitmentConfig, @@ -45,6 +47,7 @@ where ) } +#[allow(clippy::result_large_err)] pub(crate) fn get_blocks_with_retry( client: &Arc, start_slot: Slot, diff --git a/cli/src/address_lookup_table.rs b/cli/src/address_lookup_table.rs index 7dc861d1363..47a72dfac20 100644 --- a/cli/src/address_lookup_table.rs +++ b/cli/src/address_lookup_table.rs @@ -248,6 +248,7 @@ impl AddressLookupTableSubCommands for App<'_, '_> { } } +#[allow(clippy::result_large_err)] pub fn parse_address_lookup_table_subcommand( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, diff --git a/cli/src/checks.rs b/cli/src/checks.rs index 7a4b64ee1f5..4ec3fd92e17 100644 --- a/cli/src/checks.rs +++ b/cli/src/checks.rs @@ -5,6 +5,7 @@ use { solana_rpc_client_api::client_error::Result as ClientResult, }; +#[allow(clippy::result_large_err)] pub fn check_account_for_fee( rpc_client: &RpcClient, account_pubkey: &Pubkey, @@ -13,6 +14,7 @@ pub fn check_account_for_fee( check_account_for_multiple_fees(rpc_client, account_pubkey, &[message]) } +#[allow(clippy::result_large_err)] pub fn check_account_for_fee_with_commitment( rpc_client: &RpcClient, account_pubkey: &Pubkey, @@ -27,6 +29,7 @@ pub fn check_account_for_fee_with_commitment( ) } +#[allow(clippy::result_large_err)] pub fn check_account_for_multiple_fees( rpc_client: &RpcClient, account_pubkey: &Pubkey, @@ -40,6 +43,7 @@ pub fn check_account_for_multiple_fees( ) } +#[allow(clippy::result_large_err)] pub fn check_account_for_multiple_fees_with_commitment( rpc_client: &RpcClient, account_pubkey: &Pubkey, @@ -55,6 +59,7 @@ pub fn check_account_for_multiple_fees_with_commitment( ) } +#[allow(clippy::result_large_err)] pub fn check_account_for_spend_multiple_fees_with_commitment( rpc_client: &RpcClient, account_pubkey: &Pubkey, @@ -72,6 +77,7 @@ pub fn check_account_for_spend_multiple_fees_with_commitment( ) } +#[allow(clippy::result_large_err)] pub fn check_account_for_spend_and_fee_with_commitment( rpc_client: &RpcClient, account_pubkey: &Pubkey, @@ -110,6 +116,7 @@ pub fn check_account_for_spend_and_fee_with_commitment( Ok(()) } +#[allow(clippy::result_large_err)] pub fn get_fee_for_messages( rpc_client: &RpcClient, messages: &[&Message], @@ -122,6 +129,7 @@ pub fn get_fee_for_messages( .sum()) } +#[allow(clippy::result_large_err)] pub fn check_account_for_balance( rpc_client: &RpcClient, account_pubkey: &Pubkey, @@ -135,6 +143,7 @@ pub fn check_account_for_balance( ) } +#[allow(clippy::result_large_err)] pub fn check_account_for_balance_with_commitment( rpc_client: &RpcClient, account_pubkey: &Pubkey, @@ -150,6 +159,7 @@ pub fn check_account_for_balance_with_commitment( Ok(false) } +#[allow(clippy::result_large_err)] pub fn check_unique_pubkeys( pubkey0: (&Pubkey, String), pubkey1: (&Pubkey, String), diff --git a/cli/src/cli.rs b/cli/src/cli.rs index a7d5d5cbf80..f6e196b8250 100644 --- a/cli/src/cli.rs +++ b/cli/src/cli.rs @@ -1718,6 +1718,7 @@ pub fn process_command(config: &CliConfig) -> ProcessResult { } } +#[allow(clippy::result_large_err)] pub fn request_and_confirm_airdrop( rpc_client: &RpcClient, config: &CliConfig, diff --git a/cli/src/cluster_query.rs b/cli/src/cluster_query.rs index eb9f98243a3..631b0877fd6 100644 --- a/cli/src/cluster_query.rs +++ b/cli/src/cluster_query.rs @@ -511,6 +511,7 @@ impl ClusterQuerySubCommands for App<'_, '_> { } } +#[allow(clippy::result_large_err)] pub fn parse_catchup( matches: &ArgMatches<'_>, wallet_manager: &mut Option>, @@ -542,6 +543,7 @@ pub fn parse_catchup( })) } +#[allow(clippy::result_large_err)] pub fn parse_cluster_ping( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -570,6 +572,7 @@ pub fn parse_cluster_ping( }) } +#[allow(clippy::result_large_err)] pub fn parse_get_block(matches: &ArgMatches<'_>) -> Result { let slot = value_of(matches, "slot"); Ok(CliCommandInfo::without_signers(CliCommand::GetBlock { @@ -577,6 +580,7 @@ pub fn parse_get_block(matches: &ArgMatches<'_>) -> Result, ) -> Result { @@ -590,6 +594,7 @@ pub fn parse_get_recent_prioritization_fees( )) } +#[allow(clippy::result_large_err)] pub fn parse_get_block_time(matches: &ArgMatches<'_>) -> Result { let slot = value_of(matches, "slot"); Ok(CliCommandInfo::without_signers(CliCommand::GetBlockTime { @@ -597,22 +602,27 @@ pub fn parse_get_block_time(matches: &ArgMatches<'_>) -> Result) -> Result { Ok(CliCommandInfo::without_signers(CliCommand::GetEpoch)) } +#[allow(clippy::result_large_err)] pub fn parse_get_epoch_info(_matches: &ArgMatches<'_>) -> Result { Ok(CliCommandInfo::without_signers(CliCommand::GetEpochInfo)) } +#[allow(clippy::result_large_err)] pub fn parse_get_slot(_matches: &ArgMatches<'_>) -> Result { Ok(CliCommandInfo::without_signers(CliCommand::GetSlot)) } +#[allow(clippy::result_large_err)] pub fn parse_get_block_height(_matches: &ArgMatches<'_>) -> Result { Ok(CliCommandInfo::without_signers(CliCommand::GetBlockHeight)) } +#[allow(clippy::result_large_err)] pub fn parse_largest_accounts(matches: &ArgMatches<'_>) -> Result { let filter = if matches.is_present("circulating") { Some(RpcLargestAccountsFilter::Circulating) @@ -626,6 +636,7 @@ pub fn parse_largest_accounts(matches: &ArgMatches<'_>) -> Result) -> Result { let print_accounts = matches.is_present("print_accounts"); Ok(CliCommandInfo::without_signers(CliCommand::Supply { @@ -633,16 +644,19 @@ pub fn parse_supply(matches: &ArgMatches<'_>) -> Result) -> Result { Ok(CliCommandInfo::without_signers(CliCommand::TotalSupply)) } +#[allow(clippy::result_large_err)] pub fn parse_get_transaction_count(_matches: &ArgMatches<'_>) -> Result { Ok(CliCommandInfo::without_signers( CliCommand::GetTransactionCount, )) } +#[allow(clippy::result_large_err)] pub fn parse_show_stakes( matches: &ArgMatches<'_>, wallet_manager: &mut Option>, @@ -658,6 +672,7 @@ pub fn parse_show_stakes( })) } +#[allow(clippy::result_large_err)] pub fn parse_show_validators(matches: &ArgMatches<'_>) -> Result { let use_lamports_unit = matches.is_present("lamports"); let number_validators = matches.is_present("number"); @@ -691,6 +706,7 @@ pub fn parse_show_validators(matches: &ArgMatches<'_>) -> Result, wallet_manager: &mut Option>, @@ -972,6 +988,7 @@ pub fn process_first_available_block(rpc_client: &RpcClient) -> ProcessResult { Ok(format!("{first_available_block}")) } +#[allow(clippy::result_large_err)] pub fn parse_leader_schedule(matches: &ArgMatches<'_>) -> Result { let epoch = value_of(matches, "epoch"); Ok(CliCommandInfo::without_signers( @@ -1195,6 +1212,7 @@ pub fn process_get_block_height(rpc_client: &RpcClient, _config: &CliConfig) -> Ok(block_height.to_string()) } +#[allow(clippy::result_large_err)] pub fn parse_show_block_production(matches: &ArgMatches<'_>) -> Result { let epoch = value_t!(matches, "epoch", Epoch).ok(); let slot_limit = value_t!(matches, "slot_limit", u64).ok(); @@ -1643,6 +1661,7 @@ pub fn process_ping( Ok(config.output_format.formatted_string(&cli_ping)) } +#[allow(clippy::result_large_err)] pub fn parse_logs( matches: &ArgMatches<'_>, wallet_manager: &mut Option>, diff --git a/cli/src/feature.rs b/cli/src/feature.rs index 432fd06ba37..718f78f4222 100644 --- a/cli/src/feature.rs +++ b/cli/src/feature.rs @@ -512,6 +512,7 @@ impl FeatureSubCommands for App<'_, '_> { } } +#[allow(clippy::result_large_err)] fn known_feature(feature: &Pubkey) -> Result<(), CliError> { if FEATURE_NAMES.contains_key(feature) { Ok(()) @@ -522,6 +523,7 @@ fn known_feature(feature: &Pubkey) -> Result<(), CliError> { } } +#[allow(clippy::result_large_err)] pub fn parse_feature_subcommand( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -678,6 +680,7 @@ impl ClusterInfoStats { } } +#[allow(clippy::result_large_err)] fn cluster_info_stats(rpc_client: &RpcClient) -> Result { #[derive(Default)] struct StatsEntry { @@ -776,6 +779,7 @@ fn cluster_info_stats(rpc_client: &RpcClient) -> Result { } } +#[allow(clippy::result_large_err)] pub fn parse_inflation_subcommand( matches: &ArgMatches<'_>, _default_signer: &DefaultSigner, diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 92be2e89991..7e7d89749f8 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -1,4 +1,3 @@ -#![allow(clippy::result_large_err)] macro_rules! ACCOUNT_STRING { () => { r#" Address is one of: diff --git a/cli/src/nonce.rs b/cli/src/nonce.rs index a0d14b2b43f..02a0d673290 100644 --- a/cli/src/nonce.rs +++ b/cli/src/nonce.rs @@ -204,6 +204,7 @@ impl NonceSubCommands for App<'_, '_> { } } +#[allow(clippy::result_large_err)] pub fn parse_authorize_nonce_account( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -235,6 +236,7 @@ pub fn parse_authorize_nonce_account( }) } +#[allow(clippy::result_large_err)] pub fn parse_nonce_create_account( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -268,6 +270,7 @@ pub fn parse_nonce_create_account( }) } +#[allow(clippy::result_large_err)] pub fn parse_get_nonce( matches: &ArgMatches<'_>, wallet_manager: &mut Option>, @@ -280,6 +283,7 @@ pub fn parse_get_nonce( ))) } +#[allow(clippy::result_large_err)] pub fn parse_new_nonce( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -309,6 +313,7 @@ pub fn parse_new_nonce( }) } +#[allow(clippy::result_large_err)] pub fn parse_show_nonce_account( matches: &ArgMatches<'_>, wallet_manager: &mut Option>, @@ -325,6 +330,7 @@ pub fn parse_show_nonce_account( )) } +#[allow(clippy::result_large_err)] pub fn parse_withdraw_from_nonce_account( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -359,6 +365,7 @@ pub fn parse_withdraw_from_nonce_account( }) } +#[allow(clippy::result_large_err)] pub(crate) fn parse_upgrade_nonce_account( matches: &ArgMatches<'_>, ) -> Result { @@ -376,6 +383,7 @@ pub(crate) fn parse_upgrade_nonce_account( } /// Check if a nonce account is initialized with the given authority and hash +#[allow(clippy::result_large_err)] pub fn check_nonce_account( nonce_account: &Account, nonce_authority: &Pubkey, diff --git a/cli/src/program.rs b/cli/src/program.rs index 1c7f727f232..980f782422e 100644 --- a/cli/src/program.rs +++ b/cli/src/program.rs @@ -679,6 +679,7 @@ impl ProgramSubCommands for App<'_, '_> { } } +#[allow(clippy::result_large_err)] pub fn parse_program_subcommand( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, diff --git a/cli/src/program_v4.rs b/cli/src/program_v4.rs index cd34cbe598a..b6fc905d71a 100644 --- a/cli/src/program_v4.rs +++ b/cli/src/program_v4.rs @@ -351,6 +351,7 @@ impl ProgramV4SubCommands for App<'_, '_> { } } +#[allow(clippy::result_large_err)] pub fn parse_program_v4_subcommand( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, diff --git a/cli/src/spend_utils.rs b/cli/src/spend_utils.rs index b06739376c2..49e5d39a048 100644 --- a/cli/src/spend_utils.rs +++ b/cli/src/spend_utils.rs @@ -60,6 +60,7 @@ struct SpendAndFee { fee: u64, } +#[allow(clippy::result_large_err)] pub fn resolve_spend_tx_and_check_account_balance( rpc_client: &RpcClient, sign_only: bool, @@ -86,6 +87,7 @@ where ) } +#[allow(clippy::result_large_err)] pub fn resolve_spend_tx_and_check_account_balances( rpc_client: &RpcClient, sign_only: bool, @@ -186,6 +188,7 @@ where } } +#[allow(clippy::result_large_err)] fn resolve_spend_message( rpc_client: &RpcClient, amount: SpendAmount, diff --git a/cli/src/stake.rs b/cli/src/stake.rs index facd4dc6ba0..db6083e2e96 100644 --- a/cli/src/stake.rs +++ b/cli/src/stake.rs @@ -796,6 +796,7 @@ impl StakeSubCommands for App<'_, '_> { } } +#[allow(clippy::result_large_err)] pub fn parse_create_stake_account( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -872,6 +873,7 @@ pub fn parse_create_stake_account( }) } +#[allow(clippy::result_large_err)] pub fn parse_stake_delegate_stake( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -920,6 +922,7 @@ pub fn parse_stake_delegate_stake( }) } +#[allow(clippy::result_large_err)] pub fn parse_stake_authorize( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -1049,6 +1052,7 @@ pub fn parse_stake_authorize( }) } +#[allow(clippy::result_large_err)] pub fn parse_split_stake( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -1102,6 +1106,7 @@ pub fn parse_split_stake( }) } +#[allow(clippy::result_large_err)] pub fn parse_merge_stake( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -1149,6 +1154,7 @@ pub fn parse_merge_stake( }) } +#[allow(clippy::result_large_err)] pub fn parse_stake_deactivate_stake( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -1197,6 +1203,7 @@ pub fn parse_stake_deactivate_stake( }) } +#[allow(clippy::result_large_err)] pub fn parse_stake_withdraw_stake( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -1252,6 +1259,7 @@ pub fn parse_stake_withdraw_stake( }) } +#[allow(clippy::result_large_err)] pub fn parse_stake_set_lockup( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -1321,6 +1329,7 @@ pub fn parse_stake_set_lockup( }) } +#[allow(clippy::result_large_err)] pub fn parse_show_stake_account( matches: &ArgMatches<'_>, wallet_manager: &mut Option>, @@ -1346,6 +1355,7 @@ pub fn parse_show_stake_account( )) } +#[allow(clippy::result_large_err)] pub fn parse_show_stake_history(matches: &ArgMatches<'_>) -> Result { let use_lamports_unit = matches.is_present("lamports"); let limit_results = value_of(matches, "limit").unwrap(); @@ -1357,6 +1367,7 @@ pub fn parse_show_stake_history(matches: &ArgMatches<'_>) -> Result, ) -> Result { @@ -2497,6 +2508,7 @@ fn get_stake_account_state( }) } +#[allow(clippy::result_large_err)] pub(crate) fn check_current_authority( permitted_authorities: &[Pubkey], provided_current_authority: &Pubkey, @@ -2636,6 +2648,7 @@ pub fn process_show_stake_account( Ok(config.output_format.formatted_string(&state)) } +#[allow(clippy::result_large_err)] pub fn get_account_stake_state( rpc_client: &RpcClient, stake_account_address: &Pubkey, diff --git a/cli/src/validator_info.rs b/cli/src/validator_info.rs index 950710450d6..b33f74841d5 100644 --- a/cli/src/validator_info.rs +++ b/cli/src/validator_info.rs @@ -243,6 +243,7 @@ impl ValidatorInfoSubCommands for App<'_, '_> { } } +#[allow(clippy::result_large_err)] pub fn parse_validator_info_command( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -263,6 +264,7 @@ pub fn parse_validator_info_command( }) } +#[allow(clippy::result_large_err)] pub fn parse_get_validator_info_command( matches: &ArgMatches<'_>, ) -> Result { diff --git a/cli/src/vote.rs b/cli/src/vote.rs index e3879581521..14f93d390e0 100644 --- a/cli/src/vote.rs +++ b/cli/src/vote.rs @@ -451,6 +451,7 @@ impl VoteSubCommands for App<'_, '_> { } } +#[allow(clippy::result_large_err)] pub fn parse_create_vote_account( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -520,6 +521,7 @@ pub fn parse_create_vote_account( }) } +#[allow(clippy::result_large_err)] pub fn parse_vote_authorize( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -581,6 +583,7 @@ pub fn parse_vote_authorize( }) } +#[allow(clippy::result_large_err)] pub fn parse_vote_update_validator( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -628,6 +631,7 @@ pub fn parse_vote_update_validator( }) } +#[allow(clippy::result_large_err)] pub fn parse_vote_update_commission( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -674,6 +678,7 @@ pub fn parse_vote_update_commission( }) } +#[allow(clippy::result_large_err)] pub fn parse_vote_get_account_command( matches: &ArgMatches<'_>, wallet_manager: &mut Option>, @@ -699,6 +704,7 @@ pub fn parse_vote_get_account_command( )) } +#[allow(clippy::result_large_err)] pub fn parse_withdraw_from_vote_account( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -755,6 +761,7 @@ pub fn parse_withdraw_from_vote_account( }) } +#[allow(clippy::result_large_err)] pub fn parse_close_vote_account( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, diff --git a/cli/src/wallet.rs b/cli/src/wallet.rs index dd7cd097cbe..70b90e19118 100644 --- a/cli/src/wallet.rs +++ b/cli/src/wallet.rs @@ -397,6 +397,7 @@ fn resolve_derived_address_program_id(matches: &ArgMatches<'_>, arg_name: &str) }) } +#[allow(clippy::result_large_err)] pub fn parse_account( matches: &ArgMatches<'_>, wallet_manager: &mut Option>, @@ -411,6 +412,7 @@ pub fn parse_account( })) } +#[allow(clippy::result_large_err)] pub fn parse_airdrop( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -429,6 +431,7 @@ pub fn parse_airdrop( }) } +#[allow(clippy::result_large_err)] pub fn parse_balance( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -449,6 +452,7 @@ pub fn parse_balance( }) } +#[allow(clippy::result_large_err)] pub fn parse_decode_transaction(matches: &ArgMatches<'_>) -> Result { let blob = value_t_or_exit!(matches, "transaction", String); let binary_encoding = match matches.value_of("encoding").unwrap() { @@ -469,6 +473,7 @@ pub fn parse_decode_transaction(matches: &ArgMatches<'_>) -> Result, default_signer: &DefaultSigner, @@ -495,6 +500,7 @@ pub fn parse_create_address_with_seed( }) } +#[allow(clippy::result_large_err)] pub fn parse_find_program_derived_address( matches: &ArgMatches<'_>, ) -> Result { @@ -540,6 +546,7 @@ pub fn parse_find_program_derived_address( )) } +#[allow(clippy::result_large_err)] pub fn parse_transfer( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -596,6 +603,7 @@ pub fn parse_transfer( }) } +#[allow(clippy::result_large_err)] pub fn parse_sign_offchain_message( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, @@ -613,6 +621,7 @@ pub fn parse_sign_offchain_message( }) } +#[allow(clippy::result_large_err)] pub fn parse_verify_offchain_signature( matches: &ArgMatches<'_>, default_signer: &DefaultSigner, diff --git a/local-cluster/src/cluster_tests.rs b/local-cluster/src/cluster_tests.rs index 2034f2ff53f..adf9a9e23d0 100644 --- a/local-cluster/src/cluster_tests.rs +++ b/local-cluster/src/cluster_tests.rs @@ -680,6 +680,7 @@ pub fn submit_vote_to_cluster_gossip( ) } +#[allow(clippy::result_large_err)] pub fn new_tpu_quic_client( contact_info: &ContactInfo, connection_cache: Arc, diff --git a/local-cluster/src/lib.rs b/local-cluster/src/lib.rs index 961ad0d8275..6a5b0c70327 100644 --- a/local-cluster/src/lib.rs +++ b/local-cluster/src/lib.rs @@ -1,5 +1,4 @@ #![allow(clippy::arithmetic_side_effects)] -#![allow(clippy::result_large_err)] pub mod cluster; pub mod cluster_tests; pub mod integration_tests; diff --git a/tokens/src/commands.rs b/tokens/src/commands.rs index 8540a124ffe..6b05a9364b1 100644 --- a/tokens/src/commands.rs +++ b/tokens/src/commands.rs @@ -184,6 +184,7 @@ fn apply_previous_transactions( allocations.retain(|x| x.amount > 0); } +#[allow(clippy::result_large_err)] fn transfer( client: &RpcClient, lamports: u64, @@ -324,6 +325,7 @@ fn distribution_instructions( } } +#[allow(clippy::result_large_err)] fn build_messages( client: &RpcClient, db: &mut PickleDb, @@ -398,6 +400,7 @@ fn build_messages( Ok(()) } +#[allow(clippy::result_large_err)] fn send_messages( client: &RpcClient, db: &mut PickleDb, @@ -471,6 +474,7 @@ fn send_messages( Ok(()) } +#[allow(clippy::result_large_err)] fn distribute_allocations( client: &RpcClient, db: &mut PickleDb, @@ -505,6 +509,7 @@ fn distribute_allocations( Ok(()) } +#[allow(clippy::result_large_err)] fn read_allocations( input_csv: &str, transfer_amount: Option, @@ -607,6 +612,7 @@ fn new_spinner_progress_bar() -> ProgressBar { progress_bar } +#[allow(clippy::result_large_err)] pub fn process_allocations( client: &RpcClient, args: &DistributeTokensArgs, @@ -689,6 +695,7 @@ pub fn process_allocations( Ok(opt_confirmations) } +#[allow(clippy::result_large_err)] fn finalize_transactions( client: &RpcClient, db: &mut PickleDb, @@ -722,6 +729,7 @@ fn finalize_transactions( // Update the finalized bit on any transactions that are now rooted // Return the lowest number of confirmations on the unfinalized transactions or None if all are finalized. +#[allow(clippy::result_large_err)] fn update_finalized_transactions( client: &RpcClient, db: &mut PickleDb, @@ -768,6 +776,7 @@ fn update_finalized_transactions( Ok(confirmations) } +#[allow(clippy::result_large_err)] fn log_transaction_confirmations( client: &RpcClient, db: &mut PickleDb, @@ -803,6 +812,7 @@ fn log_transaction_confirmations( Ok(()) } +#[allow(clippy::result_large_err)] pub fn get_fee_estimate_for_messages( messages: &[Message], client: &RpcClient, @@ -817,6 +827,7 @@ pub fn get_fee_estimate_for_messages( Ok(fee_estimate) } +#[allow(clippy::result_large_err)] fn check_payer_balances( messages: &[Message], allocations: &[TypedAllocation], @@ -898,6 +909,7 @@ fn check_payer_balances( Ok(()) } +#[allow(clippy::result_large_err)] pub fn process_balances( client: &RpcClient, args: &BalancesArgs, @@ -947,6 +959,7 @@ pub fn process_balances( Ok(()) } +#[allow(clippy::result_large_err)] pub fn process_transaction_log(args: &TransactionLogArgs) -> Result<(), Error> { let db = db::open_db(&args.transaction_db, true)?; db::write_transaction_log(&db, &args.output_path)?; diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs index 65b1b0017ac..2e1e4641bcb 100644 --- a/tokens/src/lib.rs +++ b/tokens/src/lib.rs @@ -1,5 +1,4 @@ #![allow(clippy::arithmetic_side_effects)] -#![allow(clippy::result_large_err)] pub mod arg_parser; pub mod args; pub mod commands; diff --git a/tokens/src/spl_token.rs b/tokens/src/spl_token.rs index 3e998c1a124..ee33f2b4ca6 100644 --- a/tokens/src/spl_token.rs +++ b/tokens/src/spl_token.rs @@ -16,6 +16,7 @@ use { }, }; +#[allow(clippy::result_large_err)] pub fn update_token_args(client: &RpcClient, args: &mut Option) -> Result<(), Error> { if let Some(spl_token_args) = args { let sender_account = client @@ -27,6 +28,7 @@ pub fn update_token_args(client: &RpcClient, args: &mut Option) -> Ok(()) } +#[allow(clippy::result_large_err)] pub fn update_decimals(client: &RpcClient, args: &mut Option) -> Result<(), Error> { if let Some(spl_token_args) = args { let mint_account = client.get_account(&spl_token_args.mint).unwrap_or_default(); @@ -73,6 +75,7 @@ pub(crate) fn build_spl_token_instructions( instructions } +#[allow(clippy::result_large_err)] pub(crate) fn check_spl_token_balances( messages: &[Message], allocations: &[TypedAllocation], @@ -110,6 +113,7 @@ pub(crate) fn check_spl_token_balances( Ok(()) } +#[allow(clippy::result_large_err)] pub(crate) fn print_token_balances( client: &RpcClient, allocation: &TypedAllocation, diff --git a/tokens/src/stake.rs b/tokens/src/stake.rs index 3f1c35a3b4d..cb87fcb08db 100644 --- a/tokens/src/stake.rs +++ b/tokens/src/stake.rs @@ -4,6 +4,7 @@ use { solana_sdk::stake::state::StakeStateV2, }; +#[allow(clippy::result_large_err)] pub fn update_stake_args(client: &RpcClient, args: &mut Option) -> Result<(), Error> { if let Some(stake_args) = args { if let Some(sender_args) = &mut stake_args.sender_stake_args {