simplify impl Termination for Result<Infallible, E>

Co-authored-by: Konrad Borowski <konrad@borowski.pw>
This commit is contained in:
Ibraheem Ahmed 2021-09-03 11:24:25 -04:00 committed by GitHub
parent 2bdd075513
commit 2433d3788e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()
}
}