Skip to content

Commit

Permalink
impl Default for ExitCode
Browse files Browse the repository at this point in the history
As suggested here
  rust-lang#106425 (comment)
  • Loading branch information
ijackson committed Aug 7, 2023
1 parent d60d63f commit b8f6d48
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library/std/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1960,6 +1960,14 @@ impl ExitCode {
}
}

/// The default value is [`ExitCode::SUCCESS`]
#[stable(feature = "process-exitcode-default", since = "CURRENT_RUSTC_VERSION")]
impl Default for ExitCode {
fn default() -> Self {
ExitCode::SUCCESS
}
}

#[stable(feature = "process_exitcode", since = "1.61.0")]
impl From<u8> for ExitCode {
/// Construct an `ExitCode` from an arbitrary u8 value.
Expand Down

0 comments on commit b8f6d48

Please sign in to comment.