@@ -35,16 +35,11 @@ pub fn builtin() -> Vec<App> {
3535 ]
3636}
3737
38- pub struct BuiltinExec < ' a > {
39- pub exec : fn ( & ' a mut Config , & ' a ArgMatches ) -> CliResult ,
40- pub alias_for : Option < & ' static str > ,
41- }
42-
43- pub fn builtin_exec ( cmd : & str ) -> Option < BuiltinExec > {
44- let exec = match cmd {
38+ pub fn builtin_exec ( cmd : & str ) -> Option < fn ( & mut Config , & ArgMatches ) -> CliResult > {
39+ let f = match cmd {
4540 "bench" => bench:: exec,
46- "build" | "b" => build:: exec,
47- "check" | "c" => check:: exec,
41+ "build" => build:: exec,
42+ "check" => check:: exec,
4843 "clean" => clean:: exec,
4944 "doc" => doc:: exec,
5045 "fetch" => fetch:: exec,
@@ -62,28 +57,19 @@ pub fn builtin_exec(cmd: &str) -> Option<BuiltinExec> {
6257 "pkgid" => pkgid:: exec,
6358 "publish" => publish:: exec,
6459 "read-manifest" => read_manifest:: exec,
65- "run" | "r" => run:: exec,
60+ "run" => run:: exec,
6661 "rustc" => rustc:: exec,
6762 "rustdoc" => rustdoc:: exec,
6863 "search" => search:: exec,
69- "test" | "t" => test:: exec,
64+ "test" => test:: exec,
7065 "uninstall" => uninstall:: exec,
7166 "update" => update:: exec,
7267 "verify-project" => verify_project:: exec,
7368 "version" => version:: exec,
7469 "yank" => yank:: exec,
7570 _ => return None ,
7671 } ;
77-
78- let alias_for = match cmd {
79- "b" => Some ( "build" ) ,
80- "c" => Some ( "check" ) ,
81- "r" => Some ( "run" ) ,
82- "t" => Some ( "test" ) ,
83- _ => None ,
84- } ;
85-
86- Some ( BuiltinExec { exec, alias_for } )
72+ Some ( f)
8773}
8874
8975pub mod bench;
0 commit comments