Skip to content

Commit

Permalink
Auto merge of #10205 - hi-rustin:rustin-patch-clippy, r=Eh2406
Browse files Browse the repository at this point in the history
Make clippy happy

Remove needless borrow.
  • Loading branch information
bors committed Dec 16, 2021
2 parents bfb7f2e + 38826af commit 8f8212c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/bin/cargo/commands/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ fn try_help(config: &Config) -> CargoResult<bool> {
};

if resolve_executable(Path::new("man")).is_ok() {
let man = match extract_man(&subcommand, "1") {
let man = match extract_man(subcommand, "1") {
Some(man) => man,
None => return Ok(false),
};
write_and_spawn(&subcommand, &man, "man")?;
write_and_spawn(subcommand, &man, "man")?;
} else {
let txt = match extract_man(&subcommand, "txt") {
let txt = match extract_man(subcommand, "txt") {
Some(txt) => txt,
None => return Ok(false),
};
if resolve_executable(Path::new("less")).is_ok() {
write_and_spawn(&subcommand, &txt, "less")?;
write_and_spawn(subcommand, &txt, "less")?;
} else if resolve_executable(Path::new("more")).is_ok() {
write_and_spawn(&subcommand, &txt, "more")?;
write_and_spawn(subcommand, &txt, "more")?;
} else {
drop(std::io::stdout().write_all(&txt));
}
Expand Down

0 comments on commit 8f8212c

Please sign in to comment.