Skip to content

Commit

Permalink
impl Default for ExitCode
Browse files Browse the repository at this point in the history
As suggested here
  #106425 (comment)
  • Loading branch information
ijackson committed Aug 7, 2023
1 parent 139b49b commit 01494da
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 @@ -1890,6 +1890,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 01494da

Please sign in to comment.