Remove NonZeroDWORD

This commit is contained in:
Chris Denton 2024-07-14 06:28:27 +00:00
parent 8b72d7a9d7
commit 1d1cae1ba5
No known key found for this signature in database
GPG Key ID: 713472F2F45627DE
2 changed files with 3 additions and 5 deletions

View File

@ -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;

View File

@ -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 {