]> git.lizzy.rs Git - rust.git/commitdiff
simplify `impl Termination for Result<Infallible, E>`
authorIbraheem Ahmed <ibrah1440@gmail.com>
Fri, 3 Sep 2021 15:24:25 +0000 (11:24 -0400)
committerGitHub <noreply@github.com>
Fri, 3 Sep 2021 15:24:25 +0000 (11:24 -0400)
Co-authored-by: Konrad Borowski <konrad@borowski.pw>
library/std/src/process.rs

index d94b68967517d279137a58b2947025e529189411..4f67cd88652e0e1e7d5b251f4c21ae82d5a3ae09 100644 (file)
@@ -2056,8 +2056,7 @@ fn report(self) -> i32 {
 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()
     }
 }