Skip to content

Commit

Permalink
Tidy up subcommand logic slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Gjengset committed Feb 17, 2022
1 parent 8f7ab52 commit 6cbf913
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/bin/cargo/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ pub fn main(config: &mut Config) -> CliResult {
(ContextKind::InvalidSubcommand, &ContextValue::String(ref cmd)) => {
Some(cmd)
}
(ContextKind::InvalidSubcommand, _) => unreachable!(),
_ => None,
})
.unwrap();
.expect("UnrecognizedSubcommand implies the presence of InvalidSubcommand");
return super::execute_external_subcommand(config, &cmd, &[&cmd, "--help"])
.map_err(|_| e.into());
} else {
Expand Down

0 comments on commit 6cbf913

Please sign in to comment.