From 8bbf27b82bad30e2fa25fe7f681b15b19be3d8b1 Mon Sep 17 00:00:00 2001 From: Andrew Hlynskyi Date: Tue, 8 Jun 2021 21:03:58 +0300 Subject: [PATCH] chore(cli): Panic on broken pipe; stylistic fix --- cli/src/error.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cli/src/error.rs b/cli/src/error.rs index e84e84fe..a595ad01 100644 --- a/cli/src/error.rs +++ b/cli/src/error.rs @@ -106,11 +106,10 @@ impl From for Error { impl From for Error { fn from(error: io::Error) -> Self { - match error { - x if x.kind() == ErrorKind::BrokenPipe => return Error::new_ignored(), - _ => (), + match error.kind() { + ErrorKind::BrokenPipe => Error::new_ignored(), + _ => Error::new(error.to_string()), } - Error::new(error.to_string()) } }