Skip to content

Commit

Permalink
use match instead of if let if
Browse files Browse the repository at this point in the history
  • Loading branch information
NickeZ committed Feb 5, 2019
1 parent 1ed749c commit 410d8e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/rustup-cli/rustup_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ use std::path::Path;
use std::process::{self, Command};

fn handle_epipe(res: Result<()>) -> Result<()> {
if let Err(Error(ErrorKind::Io(ref err), _)) = res {
if err.kind() == std::io::ErrorKind::BrokenPipe {
return Ok(());
match res {
Err(Error(ErrorKind::Io(ref err), _)) if err.kind() == std::io::ErrorKind::BrokenPipe => {
Ok(())
}
res => res,
}
res
}

pub fn main() -> Result<()> {
Expand Down

0 comments on commit 410d8e5

Please sign in to comment.