diff options
| author | Chris Denton <chris@chrisdenton.dev> | 2024-07-14 06:28:27 +0000 |
|---|---|---|
| committer | Chris Denton <chris@chrisdenton.dev> | 2024-07-15 05:01:18 +0000 |
| commit | 1d1cae1ba5f5ba41084c717fd38fdd25f3b06b64 (patch) | |
| tree | 758112c042a6492b2654aff33c1b06540e613b47 | |
| parent | 8b72d7a9d7a02cb4f2b21c1497651c84a912550a (diff) | |
| download | rust-1d1cae1ba5f5ba41084c717fd38fdd25f3b06b64.tar.gz rust-1d1cae1ba5f5ba41084c717fd38fdd25f3b06b64.zip | |
Remove NonZeroDWORD
| -rw-r--r-- | library/std/src/sys/pal/windows/c.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/pal/windows/process.rs | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/library/std/src/sys/pal/windows/c.rs b/library/std/src/sys/pal/windows/c.rs index 7dfda4f714c..1c27f624646 100644 --- a/library/std/src/sys/pal/windows/c.rs +++ b/library/std/src/sys/pal/windows/c.rs @@ -7,7 +7,6 @@ use crate::ffi::CStr; use crate::mem; -use crate::num::NonZero; pub use crate::os::raw::c_int; use crate::os::raw::{c_char, c_long, c_longlong, c_uint, c_ulong, c_ushort, c_void}; use crate::os::windows::io::{AsRawHandle, BorrowedHandle}; @@ -19,7 +18,6 @@ mod windows_sys; pub use windows_sys::*; pub type DWORD = c_ulong; -pub type NonZeroDWORD = NonZero<c_ulong>; pub type LARGE_INTEGER = c_longlong; #[cfg_attr(target_vendor = "uwp", allow(unused))] pub type LONG = c_long; diff --git a/library/std/src/sys/pal/windows/process.rs b/library/std/src/sys/pal/windows/process.rs index c62764696b8..4b4856d870d 100644 --- a/library/std/src/sys/pal/windows/process.rs +++ b/library/std/src/sys/pal/windows/process.rs @@ -19,7 +19,7 @@ use crate::path::{Path, PathBuf}; use crate::ptr; use crate::sync::Mutex; use crate::sys::args::{self, Arg}; -use crate::sys::c::{self, NonZeroDWORD, EXIT_FAILURE, EXIT_SUCCESS}; +use crate::sys::c::{self, EXIT_FAILURE, EXIT_SUCCESS}; use crate::sys::cvt; use crate::sys::fs::{File, OpenOptions}; use crate::sys::handle::Handle; @@ -717,7 +717,7 @@ pub struct ExitStatus(c::DWORD); impl ExitStatus { pub fn exit_ok(&self) -> Result<(), ExitStatusError> { - match NonZeroDWORD::try_from(self.0) { + match NonZero::<u32>::try_from(self.0) { /* was nonzero */ Ok(failure) => Err(ExitStatusError(failure)), /* was zero, couldn't convert */ Err(_) => Ok(()), } @@ -750,7 +750,7 @@ impl fmt::Display for ExitStatus { } #[derive(PartialEq, Eq, Clone, Copy, Debug)] -pub struct ExitStatusError(c::NonZeroDWORD); +pub struct ExitStatusError(NonZero<u32>); impl Into<ExitStatus> for ExitStatusError { fn into(self) -> ExitStatus { |
