diff options
| author | bors <bors@rust-lang.org> | 2015-03-25 01:42:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-25 01:42:42 +0000 |
| commit | 593db005d4dbce2ff72009c1ba03477b031b2c0f (patch) | |
| tree | b585f5625dde7ab0af35fb3dd41a67ba0507f525 /src/rustbook | |
| parent | 123a754cb8356d0e78837dd4e58103ad801309ff (diff) | |
| parent | 3021d4c56422e15331e38f4b7b04c7229e024fda (diff) | |
| download | rust-593db005d4dbce2ff72009c1ba03477b031b2c0f.tar.gz rust-593db005d4dbce2ff72009c1ba03477b031b2c0f.zip | |
Auto merge of #23681 - alexcrichton:rollup, r=alexcrichton
Diffstat (limited to 'src/rustbook')
| -rw-r--r-- | src/rustbook/subcommand.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rustbook/subcommand.rs b/src/rustbook/subcommand.rs index 473739c919d..44af43be787 100644 --- a/src/rustbook/subcommand.rs +++ b/src/rustbook/subcommand.rs @@ -32,11 +32,11 @@ pub trait Subcommand { /// Create a Subcommand object based on its name. pub fn parse_name(name: &str) -> Option<Box<Subcommand>> { - for parser in [ - help::parse_cmd as fn(&str) -> Option<Box<Subcommand>>, - build::parse_cmd as fn(&str) -> Option<Box<Subcommand>>, - serve::parse_cmd as fn(&str) -> Option<Box<Subcommand>>, - test::parse_cmd as fn(&str) -> Option<Box<Subcommand>>].iter() { + let cmds: [fn(&str) -> Option<Box<Subcommand>>; 4] = [help::parse_cmd, + build::parse_cmd, + serve::parse_cmd, + test::parse_cmd]; + for parser in cmds.iter() { let parsed = (*parser)(name); if parsed.is_some() { return parsed } } |
