Skip to content

Commit

Permalink
remove superfluous usage of allow(dead_code) (anza-xyz#1669)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey authored Jun 13, 2024
1 parent e366797 commit 7e06883
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 12 deletions.
1 change: 0 additions & 1 deletion cargo-registry/src/crate_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ pub(crate) enum DependencyType {
Normal,
}

#[allow(dead_code)]
#[derive(Clone, Debug, Deserialize, Serialize)]
pub(crate) struct Dependency {
pub name: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 0 additions & 1 deletion ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ impl Blockstore {
}))
}

#[allow(dead_code)]
pub fn live_slots_iterator(&self, root: Slot) -> impl Iterator<Item = (Slot, SlotMeta)> + '_ {
let root_forks = NextSlotsIterator::new(root, self);

Expand Down
1 change: 0 additions & 1 deletion metrics/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ pub mod test_mocks {
pub points_written: Arc<Mutex<Vec<DataPoint>>>,
}
impl MockMetricsWriter {
#[allow(dead_code)]
pub fn new() -> Self {
MockMetricsWriter {
points_written: Arc::new(Mutex::new(Vec::new())),
Expand Down
2 changes: 0 additions & 2 deletions programs/bpf_loader/src/syscalls/cpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down
1 change: 0 additions & 1 deletion programs/sbf/tests/programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion remote-wallet/src/remote_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ pub trait RemoteWallet<T> {
/// `RemoteWallet` device
#[derive(Debug)]
pub struct Device {
#[allow(dead_code)]
pub(crate) path: String,
pub(crate) info: RemoteWalletInfo,
pub wallet_type: RemoteWalletType,
Expand Down
1 change: 0 additions & 1 deletion rpc/src/rpc_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ impl RpcRequestMiddleware {
.unwrap()
}

#[allow(dead_code)]
fn internal_server_error() -> hyper::Response<hyper::Body> {
hyper::Response::builder()
.status(hyper::StatusCode::INTERNAL_SERVER_ERROR)
Expand Down
1 change: 0 additions & 1 deletion sdk/macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ impl ToTokens for ProgramSdkIdDeprecated {
}
}

#[allow(dead_code)] // `respan` may be compiled out
struct RespanInput {
to_respan: Path,
respan_using: Span,
Expand Down
2 changes: 0 additions & 2 deletions sdk/program/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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");
Expand Down

0 comments on commit 7e06883

Please sign in to comment.