Merge pull request #1150 from ahlinc/fix/panic-on-broken-pipe

Stylistic fix for #1135 - Panic on broken pipe
This commit is contained in:
Max Brunsfeld 2021-06-08 11:21:04 -07:00 committed by GitHub
commit 9d77561c43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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