Skip to content

Commit 195a6f9

Browse files
committed
unreachable
1 parent 7053941 commit 195a6f9

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/cargo/util/command_prelude.rs

+15-9
Original file line numberDiff line numberDiff line change
@@ -1376,15 +1376,21 @@ pub fn get_alias_candidates() -> Vec<clap_complete::CompletionCandidate> {
13761376
return alias_map
13771377
.iter()
13781378
.map(|(alias, cmd_info)| {
1379-
let help_text = if let CommandInfo::Alias { target } = cmd_info {
1380-
let cmd_str = target
1381-
.iter()
1382-
.map(String::as_str)
1383-
.collect::<Vec<_>>()
1384-
.join(" ");
1385-
format!("alias for {}", cmd_str)
1386-
} else {
1387-
"alias (from config)".to_string()
1379+
let help_text = match cmd_info {
1380+
CommandInfo::Alias { target } => {
1381+
let cmd_str = target
1382+
.iter()
1383+
.map(String::as_str)
1384+
.collect::<Vec<_>>()
1385+
.join(" ");
1386+
format!("alias for {}", cmd_str)
1387+
}
1388+
CommandInfo::BuiltIn { .. } => {
1389+
unreachable!("BuiltIn command shouldn't appear in alias map")
1390+
}
1391+
CommandInfo::External { .. } => {
1392+
unreachable!("External command shouldn't appear in alias map")
1393+
}
13881394
};
13891395
clap_complete::CompletionCandidate::new(alias.clone()).help(Some(help_text.into()))
13901396
})

0 commit comments

Comments
 (0)