Skip to content

Commit 6575743

Browse files
committed
clippy fix
1 parent ae70b17 commit 6575743

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/env.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ pub fn max_num_threads_by_env_variable() -> Option<NonZeroUsize> {
77
#[cfg(feature = "std")]
88
match std::env::var(MAX_NUM_THREADS_ENV_VARIABLE) {
99
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
10+
Ok(x) => NonZeroUsize::new(x), // None if 0; Some(x) if x is set to a positive bound
11+
Err(_e) => None, // not a number, ignored assuming no bound
1312
},
1413
Err(_e) => None, // not set, no bound
1514
}

0 commit comments

Comments
 (0)