@@ -35,16 +35,11 @@ pub fn builtin() -> Vec<App> {
35
35
]
36
36
}
37
37
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 {
45
40
"bench" => bench:: exec,
46
- "build" | "b" => build:: exec,
47
- "check" | "c" => check:: exec,
41
+ "build" => build:: exec,
42
+ "check" => check:: exec,
48
43
"clean" => clean:: exec,
49
44
"doc" => doc:: exec,
50
45
"fetch" => fetch:: exec,
@@ -62,28 +57,19 @@ pub fn builtin_exec(cmd: &str) -> Option<BuiltinExec> {
62
57
"pkgid" => pkgid:: exec,
63
58
"publish" => publish:: exec,
64
59
"read-manifest" => read_manifest:: exec,
65
- "run" | "r" => run:: exec,
60
+ "run" => run:: exec,
66
61
"rustc" => rustc:: exec,
67
62
"rustdoc" => rustdoc:: exec,
68
63
"search" => search:: exec,
69
- "test" | "t" => test:: exec,
64
+ "test" => test:: exec,
70
65
"uninstall" => uninstall:: exec,
71
66
"update" => update:: exec,
72
67
"verify-project" => verify_project:: exec,
73
68
"version" => version:: exec,
74
69
"yank" => yank:: exec,
75
70
_ => return None ,
76
71
} ;
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)
87
73
}
88
74
89
75
pub mod bench;
0 commit comments