Skip to content

Commit

Permalink
Implement code review
Browse files Browse the repository at this point in the history
  • Loading branch information
surban authored and gitbot committed Feb 20, 2025
1 parent 3eda322 commit a0e2eee
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions std/src/sys/pal/wasi/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ pub fn available_parallelism() -> io::Result<NonZero<usize>> {
if #[cfg(target_feature = "atomics")] {
match unsafe { libc::sysconf(libc::_SC_NPROCESSORS_ONLN) } {
-1 => Err(io::Error::last_os_error()),
0 => Err(io::Error::UNKNOWN_THREAD_COUNT),
cpus => Ok(unsafe { NonZero::new_unchecked(cpus as usize) }),
cpus => NonZero::new(cpus as usize).ok_or(io::Error::UNKNOWN_THREAD_COUNT),
}
} else {
crate::sys::unsupported()
Expand Down

0 comments on commit a0e2eee

Please sign in to comment.