Skip to content

Commit b8f6d48

Browse files
committed
impl Default for ExitCode
As suggested here rust-lang#106425 (comment)
1 parent d60d63f commit b8f6d48

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/std/src/process.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1960,6 +1960,14 @@ impl ExitCode {
19601960
}
19611961
}
19621962

1963+
/// The default value is [`ExitCode::SUCCESS`]
1964+
#[stable(feature = "process-exitcode-default", since = "CURRENT_RUSTC_VERSION")]
1965+
impl Default for ExitCode {
1966+
fn default() -> Self {
1967+
ExitCode::SUCCESS
1968+
}
1969+
}
1970+
19631971
#[stable(feature = "process_exitcode", since = "1.61.0")]
19641972
impl From<u8> for ExitCode {
19651973
/// Construct an `ExitCode` from an arbitrary u8 value.

0 commit comments

Comments
 (0)