Skip to content

Commit 6cbf913

Browse files
author
Jon Gjengset
committed
Tidy up subcommand logic slightly
1 parent 8f7ab52 commit 6cbf913

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/bin/cargo/cli.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ pub fn main(config: &mut Config) -> CliResult {
4444
(ContextKind::InvalidSubcommand, &ContextValue::String(ref cmd)) => {
4545
Some(cmd)
4646
}
47-
(ContextKind::InvalidSubcommand, _) => unreachable!(),
4847
_ => None,
4948
})
50-
.unwrap();
49+
.expect("UnrecognizedSubcommand implies the presence of InvalidSubcommand");
5150
return super::execute_external_subcommand(config, &cmd, &[&cmd, "--help"])
5251
.map_err(|_| e.into());
5352
} else {

0 commit comments

Comments
 (0)