diff options
| author | bors <bors@rust-lang.org> | 2024-02-17 05:44:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-17 05:44:08 +0000 |
| commit | bbfce9196f1c2fb224cbccd7474f8f8623eebbf9 (patch) | |
| tree | 4bdb17aaad138aa83a9464e32a25528bd360f020 /library/std/src/sys/pal/windows/thread.rs | |
| parent | d2a4ef39ca8d83bbfc277b98133c11828dd5b16e (diff) | |
| parent | d523cab910d6b89b01dad9b283a67fb2256bc41e (diff) | |
Auto merge of #3303 - rust-lang:rustup-2024-02-17, r=saethlin
Automatic Rustup
Diffstat (limited to 'library/std/src/sys/pal/windows/thread.rs')
| -rw-r--r-- | library/std/src/sys/pal/windows/thread.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/sys/pal/windows/thread.rs b/library/std/src/sys/pal/windows/thread.rs index 1fe74493519..0f709e2ec7b 100644 --- a/library/std/src/sys/pal/windows/thread.rs +++ b/library/std/src/sys/pal/windows/thread.rs @@ -1,6 +1,6 @@ use crate::ffi::CStr; use crate::io; -use crate::num::NonZeroUsize; +use crate::num::NonZero; use crate::os::windows::io::AsRawHandle; use crate::os::windows::io::HandleOrNull; use crate::ptr; @@ -110,7 +110,7 @@ impl Thread { } } -pub fn available_parallelism() -> io::Result<NonZeroUsize> { +pub fn available_parallelism() -> io::Result<NonZero<usize>> { let res = unsafe { let mut sysinfo: c::SYSTEM_INFO = crate::mem::zeroed(); c::GetSystemInfo(&mut sysinfo); @@ -121,7 +121,7 @@ pub fn available_parallelism() -> io::Result<NonZeroUsize> { io::ErrorKind::NotFound, "The number of hardware threads is not known for the target platform", )), - cpus => Ok(unsafe { NonZeroUsize::new_unchecked(cpus) }), + cpus => Ok(unsafe { NonZero::new_unchecked(cpus) }), } } |
