From d707fa0fad5bb33f7609eb0437747ec543d0a308 Mon Sep 17 00:00:00 2001 From: Kevin K Date: Sun, 24 Jan 2016 09:24:15 -0500 Subject: [PATCH] tests(v2): updating yaml tests to new v2 base --- src/app/mod.rs | 3 ++- src/args/arg.rs | 2 +- src/args/subcommand.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/mod.rs b/src/app/mod.rs index 84f83ffd..6d658a14 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -87,7 +87,8 @@ impl<'a, 'b> App<'a, 'b> { /// let app = App::from_yaml(yml); /// ``` #[cfg(feature = "yaml")] - pub fn from_yaml<'y>(mut yaml: &'y Yaml) -> App<'y, 'y, 'y, 'y, 'y, 'y> { + pub fn from_yaml<'y>(mut yaml: &'y Yaml) -> App<'y, 'y> { + use args::SubCommand; // We WANT this to panic on error...so expect() is good. let mut is_sc = None; let mut a = if let Some(name) = yaml["name"].as_str() { diff --git a/src/args/arg.rs b/src/args/arg.rs index f93795db..cce4bc78 100644 --- a/src/args/arg.rs +++ b/src/args/arg.rs @@ -159,7 +159,7 @@ impl<'a, 'b> Arg<'a, 'b> { /// let arg = Arg::from_yaml(yml); /// ``` #[cfg(feature = "yaml")] - pub fn from_yaml<'y>(y: &'y BTreeMap) -> Arg<'y> { + pub fn from_yaml<'y>(y: &'y BTreeMap) -> Arg<'y, 'y> { // We WANT this to panic on error...so expect() is good. let name_yml = y.keys().nth(0).unwrap(); let name_str = name_yml.as_str().unwrap(); diff --git a/src/args/subcommand.rs b/src/args/subcommand.rs index 2591c038..fc7ebdf5 100644 --- a/src/args/subcommand.rs +++ b/src/args/subcommand.rs @@ -57,7 +57,7 @@ impl<'a> SubCommand<'a> { /// let sc = SubCommand::from_yaml(sc_yaml); /// ``` #[cfg(feature = "yaml")] - pub fn from_yaml<'y>(yaml: &'y Yaml) -> App<'y> { + pub fn from_yaml<'y>(yaml: &'y Yaml) -> App<'y, 'y> { App::from_yaml(yaml) } }