From 7e0688341e2ab4a02bc27f5d44a794631f9dd465 Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Thu, 13 Jun 2024 18:52:49 +0400 Subject: [PATCH] remove superfluous usage of allow(dead_code) (#1669) --- cargo-registry/src/crate_handler.rs | 1 - .../banking_stage/transaction_scheduler/in_flight_tracker.rs | 1 - ledger/src/blockstore.rs | 1 - metrics/src/metrics.rs | 1 - programs/bpf_loader/src/syscalls/cpi.rs | 2 -- programs/sbf/tests/programs.rs | 1 - remote-wallet/src/remote_wallet.rs | 1 - rpc/src/rpc_service.rs | 1 - sdk/macro/src/lib.rs | 1 - sdk/program/src/log.rs | 2 -- 10 files changed, 12 deletions(-) diff --git a/cargo-registry/src/crate_handler.rs b/cargo-registry/src/crate_handler.rs index ad8aa003978939..3354af6c892f03 100644 --- a/cargo-registry/src/crate_handler.rs +++ b/cargo-registry/src/crate_handler.rs @@ -43,7 +43,6 @@ pub(crate) enum DependencyType { Normal, } -#[allow(dead_code)] #[derive(Clone, Debug, Deserialize, Serialize)] pub(crate) struct Dependency { pub name: String, diff --git a/core/src/banking_stage/transaction_scheduler/in_flight_tracker.rs b/core/src/banking_stage/transaction_scheduler/in_flight_tracker.rs index 74f142b53b4156..243f14c66920a0 100644 --- a/core/src/banking_stage/transaction_scheduler/in_flight_tracker.rs +++ b/core/src/banking_stage/transaction_scheduler/in_flight_tracker.rs @@ -34,7 +34,6 @@ impl InFlightTracker { } /// Returns the number of cus that are in flight for each thread. - #[allow(dead_code)] pub fn cus_in_flight_per_thread(&self) -> &[u64] { &self.cus_in_flight_per_thread } diff --git a/ledger/src/blockstore.rs b/ledger/src/blockstore.rs index 19173fe1feb9ff..450f7b4f005f3c 100644 --- a/ledger/src/blockstore.rs +++ b/ledger/src/blockstore.rs @@ -590,7 +590,6 @@ impl Blockstore { })) } - #[allow(dead_code)] pub fn live_slots_iterator(&self, root: Slot) -> impl Iterator + '_ { let root_forks = NextSlotsIterator::new(root, self); diff --git a/metrics/src/metrics.rs b/metrics/src/metrics.rs index aae2dabb364077..2c7c025296d14a 100644 --- a/metrics/src/metrics.rs +++ b/metrics/src/metrics.rs @@ -548,7 +548,6 @@ pub mod test_mocks { pub points_written: Arc>>, } impl MockMetricsWriter { - #[allow(dead_code)] pub fn new() -> Self { MockMetricsWriter { points_written: Arc::new(Mutex::new(Vec::new())), diff --git a/programs/bpf_loader/src/syscalls/cpi.rs b/programs/bpf_loader/src/syscalls/cpi.rs index 9b94844995e12d..71d5736f895e70 100644 --- a/programs/bpf_loader/src/syscalls/cpi.rs +++ b/programs/bpf_loader/src/syscalls/cpi.rs @@ -588,9 +588,7 @@ struct SolAccountInfo { data_addr: u64, owner_addr: u64, rent_epoch: u64, - #[allow(dead_code)] is_signer: bool, - #[allow(dead_code)] is_writable: bool, executable: bool, } diff --git a/programs/sbf/tests/programs.rs b/programs/sbf/tests/programs.rs index b0f2a95c195414..62f12bcef1d823 100644 --- a/programs/sbf/tests/programs.rs +++ b/programs/sbf/tests/programs.rs @@ -681,7 +681,6 @@ fn test_return_data_and_log_data_syscall() { fn test_program_sbf_invoke_sanity() { solana_logger::setup(); - #[allow(dead_code)] #[derive(Debug)] enum Languages { C, diff --git a/remote-wallet/src/remote_wallet.rs b/remote-wallet/src/remote_wallet.rs index 33d3b7b993909f..738a9bbf52114d 100644 --- a/remote-wallet/src/remote_wallet.rs +++ b/remote-wallet/src/remote_wallet.rs @@ -252,7 +252,6 @@ pub trait RemoteWallet { /// `RemoteWallet` device #[derive(Debug)] pub struct Device { - #[allow(dead_code)] pub(crate) path: String, pub(crate) info: RemoteWalletInfo, pub wallet_type: RemoteWalletType, diff --git a/rpc/src/rpc_service.rs b/rpc/src/rpc_service.rs index 10580b4711c054..00f319f1c27b6f 100644 --- a/rpc/src/rpc_service.rs +++ b/rpc/src/rpc_service.rs @@ -114,7 +114,6 @@ impl RpcRequestMiddleware { .unwrap() } - #[allow(dead_code)] fn internal_server_error() -> hyper::Response { hyper::Response::builder() .status(hyper::StatusCode::INTERNAL_SERVER_ERROR) diff --git a/sdk/macro/src/lib.rs b/sdk/macro/src/lib.rs index 3c2a3bdb86a9ee..73121b568003cd 100644 --- a/sdk/macro/src/lib.rs +++ b/sdk/macro/src/lib.rs @@ -180,7 +180,6 @@ impl ToTokens for ProgramSdkIdDeprecated { } } -#[allow(dead_code)] // `respan` may be compiled out struct RespanInput { to_respan: Path, respan_using: Span, diff --git a/sdk/program/src/log.rs b/sdk/program/src/log.rs index 1b996238999f6d..4f3463f8dc1201 100644 --- a/sdk/program/src/log.rs +++ b/sdk/program/src/log.rs @@ -124,7 +124,6 @@ pub fn sol_log_data(data: &[&[u8]]) { } /// Print the hexadecimal representation of a slice. -#[allow(dead_code)] pub fn sol_log_slice(slice: &[u8]) { for (i, s) in slice.iter().enumerate() { sol_log_64(0, 0, 0, i as u64, *s as u64); @@ -135,7 +134,6 @@ pub fn sol_log_slice(slice: &[u8]) { /// /// - `accounts` - A slice of [`AccountInfo`]. /// - `data` - The instruction data. -#[allow(dead_code)] pub fn sol_log_params(accounts: &[AccountInfo], data: &[u8]) { for (i, account) in accounts.iter().enumerate() { msg!("AccountInfo");