Skip to content

Commit f4f205f

Browse files
Rimeeeeeemattsse
andauthored
changed possible #[allow()] -> #[expect()] (paradigmxyz#15168)
Co-authored-by: Matthias Seitz <[email protected]>
1 parent 35a5d05 commit f4f205f

File tree

112 files changed

+164
-164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+164
-164
lines changed

bin/reth/src/cli/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ impl<C: ChainSpecParser<ChainSpec = ChainSpec>, Ext: clap::Args + fmt::Debug> Cl
235235

236236
/// Commands to be executed
237237
#[derive(Debug, Subcommand)]
238-
#[allow(clippy::large_enum_variant)]
238+
#[expect(clippy::large_enum_variant)]
239239
pub enum Commands<C: ChainSpecParser, Ext: clap::Args + fmt::Debug> {
240240
/// Start the node
241241
#[command(name = "node")]

book/sources/exex/hello-world/src/bin/2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use reth_exex::ExExContext;
33
use reth_node_ethereum::EthereumNode;
44

55
async fn my_exex<Node: FullNodeComponents>(mut _ctx: ExExContext<Node>) -> eyre::Result<()> {
6-
#[allow(clippy::empty_loop)]
6+
#[expect(clippy::empty_loop)]
77
loop {}
88
}
99

book/sources/exex/remote/src/exex_2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use tokio::sync::{broadcast, mpsc};
99
use tokio_stream::wrappers::ReceiverStream;
1010
use tonic::{transport::Server, Request, Response, Status};
1111

12-
#[allow(dead_code)]
12+
#[expect(dead_code)]
1313
struct ExExService {
1414
notifications: Arc<broadcast::Sender<ExExNotification>>,
1515
}

book/sources/exex/remote/src/exex_4.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl RemoteExEx for ExExService {
4646
}
4747

4848
// ANCHOR: snippet
49-
#[allow(dead_code)]
49+
#[expect(dead_code)]
5050
async fn remote_exex<Node: FullNodeComponents<Types: NodeTypes<Primitives = EthPrimitives>>>(
5151
mut ctx: ExExContext<Node>,
5252
notifications: Arc<broadcast::Sender<ExExNotification>>,

crates/chain-state/src/memory_overlay.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::sync::OnceLock;
1616

1717
/// A state provider that stores references to in-memory blocks along with their state as well as a
1818
/// reference of the historical state provider for fallback lookups.
19-
#[allow(missing_debug_implementations)]
19+
#[expect(missing_debug_implementations)]
2020
pub struct MemoryOverlayStateProviderRef<
2121
'a,
2222
N: NodePrimitives = reth_ethereum_primitives::EthPrimitives,

crates/cli/commands/src/db/diff.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ struct TableDiffElement<T: Table> {
242242
key: T::Key,
243243

244244
/// The element from the first table
245-
#[allow(dead_code)]
245+
#[expect(dead_code)]
246246
first: T::Value,
247247

248248
/// The element from the second table
249-
#[allow(dead_code)]
249+
#[expect(dead_code)]
250250
second: T::Value,
251251
}
252252

@@ -333,11 +333,11 @@ where
333333
#[derive(Debug)]
334334
enum ExtraTableElement<T: Table> {
335335
/// The extra element that is in the first table
336-
#[allow(dead_code)]
336+
#[expect(dead_code)]
337337
First { key: T::Key, value: T::Value },
338338

339339
/// The extra element that is in the second table
340-
#[allow(dead_code)]
340+
#[expect(dead_code)]
341341
Second { key: T::Key, value: T::Value },
342342
}
343343

crates/e2e-test-utils/src/rpc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use reth_rpc_eth_api::{
1111
EthApiTypes,
1212
};
1313

14-
#[allow(missing_debug_implementations)]
14+
#[expect(missing_debug_implementations)]
1515
pub struct RpcTestContext<Node: FullNodeComponents, EthApi: EthApiTypes> {
1616
pub inner: RpcRegistry<Node, EthApi>,
1717
}

crates/e2e-test-utils/src/testsuite/actions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub trait Action<I>: Send + 'static {
2222
}
2323

2424
/// Simplified action container for storage in tests
25-
#[allow(missing_debug_implementations)]
25+
#[expect(missing_debug_implementations)]
2626
pub struct ActionBox<I>(Box<dyn Action<I>>);
2727

2828
impl<I: 'static> ActionBox<I> {
@@ -262,7 +262,7 @@ where
262262
}
263263

264264
/// Run a sequence of actions in series.
265-
#[allow(missing_debug_implementations)]
265+
#[expect(missing_debug_implementations)]
266266
pub struct Sequence<I> {
267267
/// Actions to execute in sequence
268268
pub actions: Vec<Box<dyn Action<I>>>,

crates/e2e-test-utils/src/testsuite/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<I> Default for Environment<I> {
6060
}
6161

6262
/// Builder for creating test scenarios
63-
#[allow(missing_debug_implementations)]
63+
#[expect(missing_debug_implementations)]
6464
#[derive(Default)]
6565
pub struct TestBuilder<I> {
6666
setup: Option<Setup<I>>,

crates/engine/local/src/service.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ where
6464
N: EngineNodeTypes,
6565
{
6666
/// Constructor for [`LocalEngineService`].
67-
#[allow(clippy::too_many_arguments)]
67+
#[expect(clippy::too_many_arguments)]
6868
pub fn new<B, V, C>(
6969
consensus: Arc<dyn FullConsensus<N::Primitives, Error = ConsensusError>>,
7070
executor_factory: impl BlockExecutorProvider<Primitives = N::Primitives>,

crates/engine/primitives/src/forkchoice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ impl ForkchoiceStateTracker {
4545
}
4646

4747
/// Returns whether the latest received FCU is valid: [`ForkchoiceStatus::Valid`]
48-
#[allow(dead_code)]
48+
#[expect(dead_code)]
4949
pub(crate) fn is_latest_valid(&self) -> bool {
5050
self.latest_status().is_some_and(|s| s.is_valid())
5151
}
5252

5353
/// Returns whether the latest received FCU is syncing: [`ForkchoiceStatus::Syncing`]
54-
#[allow(dead_code)]
54+
#[expect(dead_code)]
5555
pub(crate) fn is_latest_syncing(&self) -> bool {
5656
self.latest_status().is_some_and(|s| s.is_syncing())
5757
}

crates/engine/service/src/service.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type EngineServiceType<N, Client> = ChainOrchestrator<
5151

5252
/// The type that drives the chain forward and communicates progress.
5353
#[pin_project]
54-
#[allow(missing_debug_implementations)]
54+
#[expect(missing_debug_implementations)]
5555
// TODO(mattsse): remove hidde once fixed : <https://github.com/rust-lang/rust/issues/135363>
5656
// otherwise rustdoc fails to resolve the alias
5757
#[doc(hidden)]
@@ -72,7 +72,7 @@ where
7272
E: BlockExecutorProvider<Primitives = N::Primitives> + 'static,
7373
{
7474
/// Constructor for `EngineService`.
75-
#[allow(clippy::too_many_arguments)]
75+
#[expect(clippy::too_many_arguments)]
7676
pub fn new<V, C>(
7777
consensus: Arc<dyn FullConsensus<N::Primitives, Error = ConsensusError>>,
7878
executor_factory: E,

crates/engine/tree/src/backfill.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<N: ProviderNodeTypes> PipelineSync<N> {
9999
}
100100

101101
/// Returns `true` if a pipeline target is queued and will be triggered on the next `poll`.
102-
#[allow(dead_code)]
102+
#[expect(dead_code)]
103103
const fn is_pipeline_sync_pending(&self) -> bool {
104104
self.pending_pipeline_target.is_some() && self.pipeline_state.is_idle()
105105
}
@@ -212,7 +212,7 @@ impl<N: ProviderNodeTypes> BackfillSync for PipelineSync<N> {
212212
/// blockchain tree any messages that would result in database writes, since it would result in a
213213
/// deadlock.
214214
#[derive(Debug)]
215-
#[allow(clippy::large_enum_variant)]
215+
#[expect(clippy::large_enum_variant)]
216216
enum PipelineState<N: ProviderNodeTypes> {
217217
/// Pipeline is idle.
218218
Idle(Option<Pipeline<N>>),

crates/engine/tree/src/download.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub enum DownloadOutcome<B: Block> {
5555
}
5656

5757
/// Basic [`BlockDownloader`].
58-
#[allow(missing_debug_implementations)]
58+
#[expect(missing_debug_implementations)]
5959
pub struct BasicBlockDownloader<Client, B: Block>
6060
where
6161
Client: BlockClient + 'static,

crates/engine/tree/src/tree/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ mod metrics;
7272
mod payload_processor;
7373
mod persistence_state;
7474
// TODO(alexey): compare trie updates in `insert_block_inner`
75-
#[allow(unused)]
75+
#[expect(unused)]
7676
mod trie_updates;
7777

7878
use crate::tree::error::AdvancePersistenceError;
@@ -3126,7 +3126,7 @@ mod tests {
31263126
}
31273127

31283128
/// Signals to the channel task that a value should be released
3129-
#[allow(dead_code)]
3129+
#[expect(dead_code)]
31303130
fn release(&self) {
31313131
let _ = self.release.send(());
31323132
}

crates/engine/tree/src/tree/payload_processor/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ impl ExecutionCache {
400400
}
401401

402402
/// Clears the tracked cache
403-
#[allow(unused)]
403+
#[expect(unused)]
404404
pub(crate) fn clear(&self) {
405405
self.inner.write().take();
406406
}

crates/engine/tree/src/tree/payload_processor/sparse_trie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const SPARSE_TRIE_INCREMENTAL_LEVEL: usize = 2;
2626
/// A task responsible for populating the sparse trie.
2727
pub(super) struct SparseTrieTask<BPF> {
2828
/// Executor used to spawn subtasks.
29-
#[allow(unused)] // TODO use this for spawning trie tasks
29+
#[expect(unused)] // TODO use this for spawning trie tasks
3030
pub(super) executor: WorkloadExecutor,
3131
/// Receives updates from the state root task.
3232
pub(super) updates: mpsc::Receiver<SparseTrieUpdate>,

crates/engine/tree/src/tree/trie_updates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ pub(super) fn compare_trie_updates(
162162
let (mut task, mut regular) =
163163
(task.storage_tries.remove(&key), regular.storage_tries.remove(&key));
164164
if task != regular {
165-
#[allow(clippy::or_fun_call)]
165+
#[expect(clippy::or_fun_call)]
166166
let storage_diff = compare_storage_trie_updates(
167167
|| trie_cursor_factory.storage_trie_cursor(key),
168168
// Compare non-existent storage tries as empty.

crates/ethereum/primitives/src/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ pub(super) mod serde_bincode_compat {
967967
/// Bincode-compatible [`super::Transaction`] serde implementation.
968968
#[derive(Debug)]
969969
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
970-
#[allow(missing_docs)]
970+
#[expect(missing_docs)]
971971
pub enum Transaction<'a> {
972972
Legacy(TxLegacy<'a>),
973973
Eip2930(TxEip2930<'a>),

crates/evm/execution-types/src/chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ impl From<BlockHash> for ChainSplitTarget {
498498

499499
/// Result of a split chain.
500500
#[derive(Clone, Debug, PartialEq, Eq)]
501-
#[allow(clippy::large_enum_variant)]
501+
#[expect(clippy::large_enum_variant)]
502502
pub enum ChainSplit<N: NodePrimitives = reth_ethereum_primitives::EthPrimitives> {
503503
/// Chain is not split. Pending chain is returned.
504504
/// Given block split is higher than last block.

crates/evm/execution-types/src/execution_outcome.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ pub(super) mod serde_bincode_compat {
436436
bundle: Cow<'a, BundleState>,
437437
receipts: Vec<Vec<T::BincodeRepr<'a>>>,
438438
first_block: BlockNumber,
439-
#[allow(clippy::owned_cow)]
439+
#[expect(clippy::owned_cow)]
440440
requests: Cow<'a, Vec<Requests>>,
441441
}
442442

crates/evm/src/execute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ where
370370
}
371371

372372
/// A generic block executor provider that can create executors using a strategy factory.
373-
#[allow(missing_debug_implementations)]
373+
#[expect(missing_debug_implementations)]
374374
pub struct BasicBlockExecutorProvider<F> {
375375
strategy_factory: F,
376376
}

crates/exex/exex/src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ mod tests {
150150
/// <https://github.com/paradigmxyz/reth/issues/12054>
151151
#[test]
152152
const fn issue_12054() {
153-
#[allow(dead_code)]
153+
#[expect(dead_code)]
154154
struct ExEx<Node: FullNodeComponents> {
155155
ctx: ExExContext<Node>,
156156
}

crates/exex/exex/src/notifications.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub trait ExExNotificationsStream<N: NodePrimitives = EthPrimitives>:
6464
}
6565

6666
#[derive(Debug)]
67-
#[allow(clippy::large_enum_variant)]
67+
#[expect(clippy::large_enum_variant)]
6868
enum ExExNotificationsInner<P, E>
6969
where
7070
E: BlockExecutorProvider,

crates/exex/types/src/notification.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ pub(super) mod serde_bincode_compat {
9696
/// }
9797
/// ```
9898
#[derive(Debug, Serialize, Deserialize)]
99-
#[allow(missing_docs)]
99+
#[expect(missing_docs)]
100100
#[serde(bound = "")]
101-
#[allow(clippy::large_enum_variant)]
101+
#[expect(clippy::large_enum_variant)]
102102
pub enum ExExNotification<'a, N>
103103
where
104104
N: NodePrimitives,

crates/net/discv5/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl Discv5 {
225225

226226
/// Process an event from the underlying [`discv5::Discv5`] node.
227227
pub fn on_discv5_update(&self, update: discv5::Event) -> Option<DiscoveredPeer> {
228-
#[allow(clippy::match_same_arms)]
228+
#[expect(clippy::match_same_arms)]
229229
match update {
230230
discv5::Event::SocketUpdated(_) | discv5::Event::TalkRequest(_) |
231231
// `Discovered` not unique discovered peers
@@ -772,8 +772,8 @@ mod test {
772772

773773
// Copied from sigp/discv5 with slight modification (U256 type)
774774
// <https://github.com/sigp/discv5/blob/master/src/kbucket/key.rs#L89-L101>
775-
#[allow(unreachable_pub)]
776-
#[allow(unused)]
775+
#[expect(unreachable_pub)]
776+
#[expect(unused)]
777777
#[allow(clippy::assign_op_pattern)]
778778
mod sigp {
779779
use alloy_primitives::U256;

crates/net/dns/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl DnsDiscoveryHandle {
9090

9191
/// A client that discovers nodes via DNS.
9292
#[must_use = "Service does nothing unless polled"]
93-
#[allow(missing_debug_implementations)]
93+
#[expect(missing_debug_implementations)]
9494
pub struct DnsDiscoveryService<R: Resolver = DnsResolver> {
9595
/// Copy of the sender half, so new [`DnsDiscoveryHandle`] can be created on demand.
9696
command_tx: UnboundedSender<DnsDiscoveryCommand>,

crates/net/downloaders/src/bodies/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/// A naive concurrent downloader.
2-
#[allow(clippy::module_inception)]
2+
#[expect(clippy::module_inception)]
33
pub mod bodies;
44

55
/// A body downloader that does nothing. Useful to build unwind-only pipelines.

crates/net/downloaders/src/bodies/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ mod tests {
213213
}
214214

215215
#[tokio::test(flavor = "multi_thread")]
216-
#[allow(clippy::reversed_empty_ranges)]
216+
#[expect(clippy::reversed_empty_ranges)]
217217
async fn set_download_range_error_returned() {
218218
reth_tracing::init_test_tracing();
219219
let factory = create_test_provider_factory();

crates/net/eth-wire/tests/fuzz_roundtrip.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ where
3737
macro_rules! fuzz_type_and_name {
3838
( $x:ty, $fuzzname:ident ) => {
3939
/// Fuzzes the round-trip encoding of the type.
40-
#[allow(non_snake_case)]
40+
#[expect(non_snake_case)]
4141
#[test_fuzz]
4242
fn $fuzzname(thing: $x) {
4343
crate::roundtrip_fuzz::<$x>(thing)
@@ -46,7 +46,7 @@ macro_rules! fuzz_type_and_name {
4646
}
4747

4848
#[cfg(test)]
49-
#[allow(missing_docs)]
49+
#[expect(missing_docs)]
5050
pub mod fuzz_rlp {
5151
use crate::roundtrip_encoding;
5252
use alloy_rlp::{RlpDecodableWrapper, RlpEncodableWrapper};

crates/net/network-api/src/noop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl NetworkInfo for NoopNetwork {
2626
}
2727

2828
async fn network_status(&self) -> Result<NetworkStatus, NetworkError> {
29-
#[allow(deprecated)]
29+
#[expect(deprecated)]
3030
Ok(NetworkStatus {
3131
client_version: "reth-test".to_string(),
3232
protocol_version: ProtocolVersion::V5 as u64,

crates/net/network/src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use tokio::sync::mpsc;
1515
pub(crate) const ETH_REQUEST_CHANNEL_CAPACITY: usize = 256;
1616

1717
/// A builder that can configure all components of the network.
18-
#[allow(missing_debug_implementations)]
18+
#[expect(missing_debug_implementations)]
1919
pub struct NetworkBuilder<Tx, Eth, N: NetworkPrimitives = EthNetworkPrimitives> {
2020
pub(crate) network: NetworkManager<N>,
2121
pub(crate) transactions: Tx,

crates/net/network/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ impl NetworkConfigBuilder<EthNetworkPrimitives> {
227227

228228
// === impl NetworkConfigBuilder ===
229229

230-
#[allow(missing_docs)]
230+
#[expect(missing_docs)]
231231
impl<N: NetworkPrimitives> NetworkConfigBuilder<N> {
232232
/// Create a new builder instance with a random secret key.
233233
pub fn with_rng_secret_key() -> Self {

crates/net/network/src/eth_requests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub struct EthRequestHandler<C, N: NetworkPrimitives = EthNetworkPrimitives> {
5757
client: C,
5858
/// Used for reporting peers.
5959
// TODO use to report spammers
60-
#[allow(dead_code)]
60+
#[expect(dead_code)]
6161
peers: PeersHandle,
6262
/// Incoming request from the [`NetworkManager`](crate::NetworkManager).
6363
incoming_requests: ReceiverStream<IncomingEthRequest<N>>,

crates/net/network/src/manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ impl<N: NetworkPrimitives> NetworkManager<N> {
443443
let status = sessions.status();
444444
let hello_message = sessions.hello_message();
445445

446-
#[allow(deprecated)]
446+
#[expect(deprecated)]
447447
NetworkStatus {
448448
client_version: hello_message.client_version,
449449
protocol_version: hello_message.protocol_version as u64,

0 commit comments

Comments
 (0)