diff --git a/Cargo.lock b/Cargo.lock index 6600f154f4296..6de9c5d0fd089 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -693,7 +693,6 @@ dependencies = [ "foundry-utils", "futures", "hex", - "num_cpus", "rayon", "rusoto_core", "rusoto_kms", diff --git a/cast/Cargo.toml b/cast/Cargo.toml index cee77a664ee80..4ea2ff583dbef 100644 --- a/cast/Cargo.toml +++ b/cast/Cargo.toml @@ -25,7 +25,6 @@ serde = "1" serde_json = "1" chrono = "0.4" hex = "0.4" -num_cpus = "1" rayon = "1" # aws diff --git a/cast/src/lib.rs b/cast/src/lib.rs index 2ad2e8b605df4..5770e71e29824 100644 --- a/cast/src/lib.rs +++ b/cast/src/lib.rs @@ -1801,7 +1801,7 @@ impl SimpleCast { eyre::bail!("Invalid signature"); }; - let num_threads = num_cpus::get(); + let num_threads = std::thread::available_parallelism().map_or(1, |n| n.get()); let found = AtomicBool::new(false); let result: Option<(u32, String, String)> =