diff options
-rw-r--r-- | Cargo.lock | 1 | ||||
-rw-r--r-- | cli/Cargo.toml | 1 | ||||
-rw-r--r-- | cli/flags.rs | 5 |
3 files changed, 4 insertions, 3 deletions
diff --git a/Cargo.lock b/Cargo.lock index 86a873675..222c61988 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -540,6 +540,7 @@ dependencies = [ "lspower", "nix", "notify", + "num_cpus", "os_pipe", "percent-encoding", "pin-project", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 707c3ec6e..f561b74e2 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -56,6 +56,7 @@ libc = "0.2.93" log = { version = "0.4.14", features = ["serde"] } lspower = "1.0.0" notify = "5.0.0-pre.7" +num_cpus = "1.13.0" percent-encoding = "2.1.0" pin-project = "1.0.6" regex = "1.4.3" diff --git a/cli/flags.rs b/cli/flags.rs index 3e63f8014..0c916ecb8 100644 --- a/cli/flags.rs +++ b/cli/flags.rs @@ -1683,9 +1683,8 @@ fn test_parse(flags: &mut Flags, matches: &clap::ArgMatches) { if let Some(value) = matches.value_of("jobs") { value.parse().unwrap() } else { - // TODO(caspervonb) when no value is given use - // https://doc.rust-lang.org/std/thread/fn.available_concurrency.html - 2 + // TODO(caspervonb) drop the dependency on num_cpus when https://doc.rust-lang.org/std/thread/fn.available_concurrency.html becomes stable. + num_cpus::get() } } else { 1 |