From f31ee8d1bfc50de6cef5b746f6fd6431b7b772e5 Mon Sep 17 00:00:00 2001 From: Casper Beyer Date: Fri, 30 Apr 2021 20:57:42 +0800 Subject: fix(test): default to num cpus when no value is given (#10443) --- cli/Cargo.toml | 1 + cli/flags.rs | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'cli') 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 -- cgit v1.2.3