Skip to content

Commit 8e00a4a

Browse files
committed
clippy
1 parent 42ceedd commit 8e00a4a

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

crates/engine/primitives/src/config.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,11 @@ impl TreeConfig {
499499

500500
/// Setter for the number of storage proof worker threads.
501501
pub const fn with_storage_worker_count(mut self, storage_worker_count: usize) -> Self {
502-
self.storage_worker_count = storage_worker_count.max(MIN_WORKER_COUNT);
502+
self.storage_worker_count = if storage_worker_count > MIN_WORKER_COUNT {
503+
storage_worker_count
504+
} else {
505+
MIN_WORKER_COUNT
506+
};
503507
self
504508
}
505509

@@ -510,7 +514,11 @@ impl TreeConfig {
510514

511515
/// Setter for the number of account proof worker threads.
512516
pub const fn with_account_worker_count(mut self, account_worker_count: usize) -> Self {
513-
self.account_worker_count = account_worker_count.max(MIN_WORKER_COUNT);
517+
self.account_worker_count = if account_worker_count > MIN_WORKER_COUNT {
518+
account_worker_count
519+
} else {
520+
MIN_WORKER_COUNT
521+
};
514522
self
515523
}
516524
}

crates/node/core/src/args/engine.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! clap [Args](clap::Args) for engine purposes
22
33
use clap::Args;
4-
use reth_engine_primitives::{TreeConfig, DEFAULT_MULTIPROOF_TASK_CHUNK_SIZE, MIN_WORKER_COUNT};
4+
use reth_engine_primitives::{TreeConfig, DEFAULT_MULTIPROOF_TASK_CHUNK_SIZE};
55

66
use crate::node_config::{
77
DEFAULT_CROSS_BLOCK_CACHE_SIZE_MB, DEFAULT_MAX_PROOF_TASK_CONCURRENCY,
@@ -111,18 +111,12 @@ pub struct EngineArgs {
111111

112112
/// Configure the number of storage proof workers in the Tokio blocking pool.
113113
/// If not specified, defaults to 2x available parallelism, clamped between 2 and 64.
114-
#[arg(
115-
long = "engine.storage-worker-count",
116-
value_parser = clap::value_parser!(usize).range(MIN_WORKER_COUNT..)
117-
)]
114+
#[arg(long = "engine.storage-worker-count")]
118115
pub storage_worker_count: Option<usize>,
119116

120117
/// Configure the number of account proof workers in the Tokio blocking pool.
121118
/// If not specified, defaults to 1.5x storage workers.
122-
#[arg(
123-
long = "engine.account-worker-count",
124-
value_parser = clap::value_parser!(usize).range(MIN_WORKER_COUNT..)
125-
)]
119+
#[arg(long = "engine.account-worker-count")]
126120
pub account_worker_count: Option<usize>,
127121
}
128122

0 commit comments

Comments
 (0)