diff --git a/claptests/Cargo.toml b/claptests/Cargo.toml index a27fd52c..1b69f588 100644 --- a/claptests/Cargo.toml +++ b/claptests/Cargo.toml @@ -6,3 +6,4 @@ authors = ["Kevin K. "] [dependencies.clap] git = "file:/home/kevin/Projects/clap-rs" +branch = "extrabox" diff --git a/src/app.rs b/src/app.rs index 25f45262..f64b7c54 100644 --- a/src/app.rs +++ b/src/app.rs @@ -48,7 +48,7 @@ pub struct App<'a, 'v, 'ab, 'u> { flags: HashMap<&'static str, FlagBuilder>, opts: HashMap<&'static str, OptBuilder>, positionals_idx: BTreeMap, - subcommands: HashMap>>, + subcommands: HashMap>, needs_long_help: bool, needs_long_version: bool, needs_short_help: bool, @@ -316,7 +316,7 @@ impl<'a, 'v, 'ab, 'u> App<'a, 'v, 'ab, 'u>{ /// ``` pub fn subcommand(mut self, subcmd: App<'a, 'v, 'ab, 'u>) -> App<'a, 'v, 'ab, 'u> { if subcmd.name == "help" { self.needs_subcmd_help = false; } - self.subcommands.insert(subcmd.name.clone(), Box::new(subcmd)); + self.subcommands.insert(subcmd.name.clone(), subcmd); self } @@ -613,7 +613,7 @@ impl<'a, 'v, 'ab, 'u> App<'a, 'v, 'ab, 'u>{ }); } if self.needs_subcmd_help && !self.subcommands.is_empty() { - self.subcommands.insert("help".to_owned(), Box::new(App::new("help").about("Prints this message"))); + self.subcommands.insert("help".to_owned(), App::new("help").about("Prints this message")); } }