@@ -111,7 +111,7 @@ use crate::ffi::OsStr;
111
111
use crate :: fmt;
112
112
use crate :: fs;
113
113
use crate :: io:: { self , BorrowedCursor , IoSlice , IoSliceMut } ;
114
- use crate :: num:: NonZeroI32 ;
114
+ use crate :: num:: NonZero ;
115
115
use crate :: path:: Path ;
116
116
use crate :: str;
117
117
use crate :: sys:: pipe:: { read2, AnonPipe } ;
@@ -1775,9 +1775,9 @@ impl ExitStatusError {
1775
1775
self . code_nonzero ( ) . map ( Into :: into)
1776
1776
}
1777
1777
1778
- /// Reports the exit code, if applicable, from an `ExitStatusError`, as a `NonZero`
1778
+ /// Reports the exit code, if applicable, from an `ExitStatusError`, as a [ `NonZero`].
1779
1779
///
1780
- /// This is exactly like [`code()`](Self::code), except that it returns a `NonZeroI32` .
1780
+ /// This is exactly like [`code()`](Self::code), except that it returns a <code>[NonZero]<[i32]></code> .
1781
1781
///
1782
1782
/// Plain `code`, returning a plain integer, is provided because it is often more convenient.
1783
1783
/// The returned value from `code()` is indeed also nonzero; use `code_nonzero()` when you want
@@ -1786,17 +1786,17 @@ impl ExitStatusError {
1786
1786
/// # Examples
1787
1787
///
1788
1788
/// ```
1789
- /// #![feature(exit_status_error)]
1789
+ /// #![feature(exit_status_error, generic_nonzero )]
1790
1790
/// # if cfg!(unix) {
1791
- /// use std::num::NonZeroI32 ;
1791
+ /// use std::num::NonZero ;
1792
1792
/// use std::process::Command;
1793
1793
///
1794
1794
/// let bad = Command::new("false").status().unwrap().exit_ok().unwrap_err();
1795
- /// assert_eq!(bad.code_nonzero().unwrap(), NonZeroI32::try_from (1).unwrap());
1795
+ /// assert_eq!(bad.code_nonzero().unwrap(), NonZero::new (1).unwrap());
1796
1796
/// # } // cfg!(unix)
1797
1797
/// ```
1798
1798
#[ must_use]
1799
- pub fn code_nonzero ( & self ) -> Option < NonZeroI32 > {
1799
+ pub fn code_nonzero ( & self ) -> Option < NonZero < i32 > > {
1800
1800
self . 0 . code ( )
1801
1801
}
1802
1802
0 commit comments