From b8f6d48eb6a551b9fd4b134ad68bc5a5f95e3a39 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 7 Aug 2023 16:08:19 +0100 Subject: [PATCH] impl Default for ExitCode As suggested here https://github.com/rust-lang/rust/pull/106425#issuecomment-1382952598 --- library/std/src/process.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 47e28c27a8376..bb94596425c6d 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -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 for ExitCode { /// Construct an `ExitCode` from an arbitrary u8 value.