chore(cli): Panic on broken pipe; stylistic fix

This commit is contained in:
Andrew Hlynskyi 2021-06-08 21:03:58 +03:00
parent ce2bb561b4
commit 8bbf27b82b

View file

@ -106,11 +106,10 @@ impl From<serde_json::Error> for Error {
impl From<io::Error> 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())
}
}