diff options
| author | bors <bors@rust-lang.org> | 2024-02-16 07:46:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-16 07:46:31 +0000 |
| commit | 1be468815cb7c6932fcc7ed3ee81e6a14376c05e (patch) | |
| tree | b0b4d37f0274c53c54e2245a73973c6ba1db47bd /library/std/src/sys/pal/windows/process.rs | |
| parent | 0f806a9812b62c36bdab08d33c14cf2d3ecf4355 (diff) | |
| parent | a90cc05233858fcd16c3ca0e0b4320fc5ae09af2 (diff) | |
| download | rust-1be468815cb7c6932fcc7ed3ee81e6a14376c05e.tar.gz rust-1be468815cb7c6932fcc7ed3ee81e6a14376c05e.zip | |
Auto merge of #120486 - reitermarkus:use-generic-nonzero, r=dtolnay
Use generic `NonZero` internally. Tracking issue: https://github.com/rust-lang/rust/issues/120257
Diffstat (limited to 'library/std/src/sys/pal/windows/process.rs')
| -rw-r--r-- | library/std/src/sys/pal/windows/process.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sys/pal/windows/process.rs b/library/std/src/sys/pal/windows/process.rs index 9ec775959fd..6a94d377140 100644 --- a/library/std/src/sys/pal/windows/process.rs +++ b/library/std/src/sys/pal/windows/process.rs @@ -12,7 +12,7 @@ use crate::fmt; use crate::io::{self, Error, ErrorKind}; use crate::mem; use crate::mem::MaybeUninit; -use crate::num::NonZeroI32; +use crate::num::NonZero; use crate::os::windows::ffi::{OsStrExt, OsStringExt}; use crate::os::windows::io::{AsHandle, AsRawHandle, BorrowedHandle, FromRawHandle, IntoRawHandle}; use crate::path::{Path, PathBuf}; @@ -747,7 +747,7 @@ impl Into<ExitStatus> for ExitStatusError { } impl ExitStatusError { - pub fn code(self) -> Option<NonZeroI32> { + pub fn code(self) -> Option<NonZero<i32>> { Some((u32::from(self.0) as i32).try_into().unwrap()) } } |
