Skip to content

Commit

Permalink
Make clippy happy
Browse files Browse the repository at this point in the history
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
  • Loading branch information
Rustin170506 committed Dec 16, 2021
1 parent 99627cd commit 38826af
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 38826af

Please sign in to comment.