Skip to content

Commit

Permalink
simplify impl Termination for Result<Infallible, E>
Browse files Browse the repository at this point in the history
Co-authored-by: Konrad Borowski <konrad@borowski.pw>
  • Loading branch information
ibraheemdev and KamilaBorowska authored Sep 3, 2021
1 parent 2bdd075 commit 2433d37
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/std/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2056,8 +2056,7 @@ impl<E: fmt::Debug> Termination for Result<!, E> {
impl<E: fmt::Debug> Termination for Result<Infallible, E> {
fn report(self) -> i32 {
let Err(err) = self;
eprintln!("Error: {:?}", err);
ExitCode::FAILURE.report()
Err::<!, _>(err).report()
}
}

Expand Down

0 comments on commit 2433d37

Please sign in to comment.