Skip to content

Commit aa45985

Browse files
committed
Remove NonZeroDWORD
1 parent 3492a6b commit aa45985

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

std/src/sys/pal/windows/c.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
use crate::ffi::CStr;
99
use crate::mem;
10-
use crate::num::NonZero;
1110
pub use crate::os::raw::c_int;
1211
use crate::os::raw::{c_char, c_long, c_longlong, c_uint, c_ulong, c_ushort, c_void};
1312
use crate::os::windows::io::{AsRawHandle, BorrowedHandle};
@@ -19,7 +18,6 @@ mod windows_sys;
1918
pub use windows_sys::*;
2019

2120
pub type DWORD = c_ulong;
22-
pub type NonZeroDWORD = NonZero<c_ulong>;
2321
pub type LARGE_INTEGER = c_longlong;
2422
#[cfg_attr(target_vendor = "uwp", allow(unused))]
2523
pub type LONG = c_long;

std/src/sys/pal/windows/process.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::path::{Path, PathBuf};
1919
use crate::ptr;
2020
use crate::sync::Mutex;
2121
use crate::sys::args::{self, Arg};
22-
use crate::sys::c::{self, NonZeroDWORD, EXIT_FAILURE, EXIT_SUCCESS};
22+
use crate::sys::c::{self, EXIT_FAILURE, EXIT_SUCCESS};
2323
use crate::sys::cvt;
2424
use crate::sys::fs::{File, OpenOptions};
2525
use crate::sys::handle::Handle;
@@ -717,7 +717,7 @@ pub struct ExitStatus(c::DWORD);
717717

718718
impl ExitStatus {
719719
pub fn exit_ok(&self) -> Result<(), ExitStatusError> {
720-
match NonZeroDWORD::try_from(self.0) {
720+
match NonZero::<u32>::try_from(self.0) {
721721
/* was nonzero */ Ok(failure) => Err(ExitStatusError(failure)),
722722
/* was zero, couldn't convert */ Err(_) => Ok(()),
723723
}
@@ -750,7 +750,7 @@ impl fmt::Display for ExitStatus {
750750
}
751751

752752
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
753-
pub struct ExitStatusError(c::NonZeroDWORD);
753+
pub struct ExitStatusError(NonZero<u32>);
754754

755755
impl Into<ExitStatus> for ExitStatusError {
756756
fn into(self) -> ExitStatus {

0 commit comments

Comments
 (0)