ensure min/max when using num_cpus return 1 or max i16
nbari opened this issue · comments
nbari commented
This:
let num_threads = (num_cpus::get_physical() - 2).max(1).to_string();
Is used in:
.arg(
Arg::new("number")
.help("Number of max concurrent requests")
.short('n')
.long("number")
.default_value(num_threads)
.value_parser(clap::value_parser!(u16).range(1..=3500))
.num_args(1)
)
But the output is never verified before to be < 3500