diff --git a/beacon_node/beacon_chain/src/state_advance_timer.rs b/beacon_node/beacon_chain/src/state_advance_timer.rs index 8bd3c2b683f..39d35f81113 100644 --- a/beacon_node/beacon_chain/src/state_advance_timer.rs +++ b/beacon_node/beacon_chain/src/state_advance_timer.rs @@ -52,8 +52,7 @@ const MAX_BLOCK_PRODUCTION_CACHE_DISTANCE: u64 = 4; enum Error { BeaconChain(BeaconChainError), // We don't use the inner value directly, but it's used in the Debug impl. - #[allow(dead_code)] - HeadMissingFromSnapshotCache(Hash256), + HeadMissingFromSnapshotCache(#[allow(dead_code)] Hash256), MaxDistanceExceeded { current_slot: Slot, head_slot: Slot, diff --git a/beacon_node/execution_layer/src/test_utils/mock_builder.rs b/beacon_node/execution_layer/src/test_utils/mock_builder.rs index 2c2f29e2f52..2c5bde55ea3 100644 --- a/beacon_node/execution_layer/src/test_utils/mock_builder.rs +++ b/beacon_node/execution_layer/src/test_utils/mock_builder.rs @@ -54,9 +54,8 @@ impl Operation { } #[derive(Debug)] -#[allow(dead_code)] // We don't use the string value directly, but it's used in the Debug impl which is required by `warp::reject::Reject`. -struct Custom(String); +struct Custom(#[allow(dead_code)] String); impl warp::reject::Reject for Custom {} diff --git a/beacon_node/execution_layer/src/test_utils/mod.rs b/beacon_node/execution_layer/src/test_utils/mod.rs index a9ea6c6db68..ce3c1042084 100644 --- a/beacon_node/execution_layer/src/test_utils/mod.rs +++ b/beacon_node/execution_layer/src/test_utils/mod.rs @@ -487,7 +487,6 @@ pub struct StaticNewPayloadResponse { should_import: bool, } #[derive(Debug)] -#[allow(dead_code)] // We don't use the string value directly, but it's used in the Debug impl which is required by `warp::reject::Reject`. struct AuthError(String); diff --git a/beacon_node/http_api/src/attestation_performance.rs b/beacon_node/http_api/src/attestation_performance.rs index 2957b2d34b7..6e3ebcccec5 100644 --- a/beacon_node/http_api/src/attestation_performance.rs +++ b/beacon_node/http_api/src/attestation_performance.rs @@ -15,12 +15,11 @@ const BLOCK_ROOT_CHUNK_SIZE: usize = 100; #[derive(Debug)] // We don't use the inner values directly, but they're used in the Debug impl. -#[allow(dead_code)] enum AttestationPerformanceError { - BlockReplay(BlockReplayError), - BeaconState(BeaconStateError), - ParticipationCache(ParticipationCacheError), - UnableToFindValidator(usize), + BlockReplay(#[allow(dead_code)] BlockReplayError), + BeaconState(#[allow(dead_code)] BeaconStateError), + ParticipationCache(#[allow(dead_code)] ParticipationCacheError), + UnableToFindValidator(#[allow(dead_code)] usize), } impl From for AttestationPerformanceError { diff --git a/beacon_node/http_api/src/block_packing_efficiency.rs b/beacon_node/http_api/src/block_packing_efficiency.rs index 16328796084..c73dcb7e02a 100644 --- a/beacon_node/http_api/src/block_packing_efficiency.rs +++ b/beacon_node/http_api/src/block_packing_efficiency.rs @@ -20,11 +20,10 @@ const BLOCK_ROOT_CHUNK_SIZE: usize = 100; #[derive(Debug)] // We don't use the inner values directly, but they're used in the Debug impl. -#[allow(dead_code)] enum PackingEfficiencyError { - BlockReplay(BlockReplayError), - BeaconState(BeaconStateError), - CommitteeStoreError(Slot), + BlockReplay(#[allow(dead_code)] BlockReplayError), + BeaconState(#[allow(dead_code)] BeaconStateError), + CommitteeStoreError(#[allow(dead_code)] Slot), InvalidAttestationError, } diff --git a/beacon_node/lighthouse_network/tests/common.rs b/beacon_node/lighthouse_network/tests/common.rs index c8b34deef4a..af48244678d 100644 --- a/beacon_node/lighthouse_network/tests/common.rs +++ b/beacon_node/lighthouse_network/tests/common.rs @@ -42,23 +42,23 @@ pub fn fork_context(fork_name: ForkName) -> ForkContext { ForkContext::new::(current_slot, Hash256::zero(), &chain_spec) } -pub struct Libp2pInstance { - service: LibP2PService, +pub struct Libp2pInstance( + LibP2PService, #[allow(dead_code)] - /// This field is managed for lifetime purposes may not be used directly, hence the `#[allow(dead_code)]` attribute. - exit_signal: exit_future::Signal, -} + // This field is managed for lifetime purposes may not be used directly, hence the `#[allow(dead_code)]` attribute. + exit_future::Signal, +); impl std::ops::Deref for Libp2pInstance { type Target = LibP2PService; fn deref(&self) -> &Self::Target { - &self.service + &self.0 } } impl std::ops::DerefMut for Libp2pInstance { fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.service + &mut self.0 } } @@ -120,13 +120,13 @@ pub async fn build_libp2p_instance( chain_spec: spec, libp2p_registry: None, }; - Libp2pInstance { - service: LibP2PService::new(executor, libp2p_context, &log) + Libp2pInstance( + LibP2PService::new(executor, libp2p_context, &log) .await .expect("should build libp2p instance") .0, - exit_signal: signal, - } + signal, + ) } #[allow(dead_code)]