Fix for for setting test-threads to 0
Running test with cargo test -- --test-threads=0 causes cargo to hang as 0 is a valid usize. Adding zero threads as a special case to the error handling.
This commit is contained in:
@@ -439,6 +439,8 @@ pub fn parse_opts(args: &[String]) -> Option<OptRes> {
|
||||
let test_threads = match matches.opt_str("test-threads") {
|
||||
Some(n_str) =>
|
||||
match n_str.parse::<usize>() {
|
||||
Ok(0) =>
|
||||
return Some(Err(format!("argument for --test-threads must not be 0"))),
|
||||
Ok(n) => Some(n),
|
||||
Err(e) =>
|
||||
return Some(Err(format!("argument for --test-threads must be a number > 0 \
|
||||
|
||||
Reference in New Issue
Block a user