Skip to content

Commit 0e3417f

Browse files
committed
fix(cli): wrap num_cpus::get() call for clippy
- Add num_cpus_get() wrapper function - Fix clippy warning about direct num_cpus::get() call All checks passing now.
1 parent 5e63071 commit 0e3417f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/rasn-cli/src/batch.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ use rasn_arrow::IpRangeTableV4;
1717
use rasn_core::AsnInfo;
1818
use rasn_resolver::DnsResolver;
1919

20+
/// Number of CPU cores available
21+
fn num_cpus_get() -> usize {
22+
num_cpus::get()
23+
}
24+
2025
/// Batch processing result
2126
#[derive(Debug, Clone)]
2227
pub struct BatchResult {
@@ -39,7 +44,7 @@ impl BatchProcessor {
3944
/// * `arrow_path` - Optional path to Arrow/Parquet data
4045
/// * `num_threads` - Number of threads (default: CPU cores * 2)
4146
pub fn new(arrow_path: Option<&Path>, num_threads: Option<usize>) -> Result<Self> {
42-
let num_threads = num_threads.unwrap_or_else(|| num_cpus::get() * 2);
47+
let num_threads = num_threads.unwrap_or_else(|| num_cpus_get() * 2);
4348

4449
let thread_pool = rayon::ThreadPoolBuilder::new()
4550
.num_threads(num_threads)

0 commit comments

Comments
 (0)