We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ae70b17 commit 6575743Copy full SHA for 6575743
src/env.rs
@@ -7,9 +7,8 @@ pub fn max_num_threads_by_env_variable() -> Option<NonZeroUsize> {
7
#[cfg(feature = "std")]
8
match std::env::var(MAX_NUM_THREADS_ENV_VARIABLE) {
9
Ok(s) => match s.parse::<usize>() {
10
- Ok(0) => None, // consistent with .num_threads(0) representing no bound
11
- Ok(x) => Some(NonZeroUsize::new(x).expect("x>0")), // set to a positive bound
12
- Err(_e) => None, // not a number, ignored assuming no bound
+ Ok(x) => NonZeroUsize::new(x), // None if 0; Some(x) if x is set to a positive bound
+ Err(_e) => None, // not a number, ignored assuming no bound
13
},
14
Err(_e) => None, // not set, no bound
15
}
0 commit comments