Skip to content

Commit ded5926

Browse files
authored
refactor: replace num_cpus with thread::available_parallelism (#526)
1 parent abe3a64 commit ded5926

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ itertools = "0.13"
6666
log = "^0.4"
6767
mockito = "^1"
6868
murmur3 = "0.5.2"
69-
num_cpus = "1"
7069
once_cell = "1"
7170
opendal = "0.48"
7271
ordered-float = "4.0.0"

crates/iceberg/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ fnv = { workspace = true }
6161
futures = { workspace = true }
6262
itertools = { workspace = true }
6363
murmur3 = { workspace = true }
64-
num_cpus = { workspace = true }
6564
once_cell = { workspace = true }
6665
opendal = { workspace = true }
6766
ordered-float = { workspace = true }

crates/iceberg/src/scan.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ pub struct TableScanBuilder<'a> {
6161

6262
impl<'a> TableScanBuilder<'a> {
6363
pub(crate) fn new(table: &'a Table) -> Self {
64-
let num_cpus = num_cpus::get();
64+
let num_cpus = std::thread::available_parallelism()
65+
.expect("failed to get number of CPUs")
66+
.get();
6567

6668
Self {
6769
table,

0 commit comments

Comments
 (0)