diff --git a/src/app/parser.rs b/src/app/parser.rs index f4f658de..10b57462 100644 --- a/src/app/parser.rs +++ b/src/app/parser.rs @@ -460,7 +460,7 @@ impl<'a, 'b> Parser<'a, 'b> // Determines if we need the `[FLAGS]` tag in the usage string pub fn needs_flags_tag(&self) -> bool { debugln!("Parser::needs_flags_tag;"); - 'outer: for f in self.flags.iter() { + 'outer: for f in &self.flags { debugln!("Parser::needs_flags_tag:iter: f={};", f.b.name); if let Some(l) = f.s.long { if l == "help" || l == "version" { @@ -1791,12 +1791,10 @@ impl<'a, 'b> Parser<'a, 'b> // Validate the conditionally required args for &(a, v, r) in &self.r_ifs { - if let Some(ref ma) = matcher.get(a) { + if let Some(ma) = matcher.get(a) { for val in ma.vals.values() { - if v == val { - if matcher.get(r).is_none() { - return self.missing_required_error(matcher); - } + if v == val && matcher.get(r).is_none() { + return self.missing_required_error(matcher); } } } diff --git a/src/args/arg.rs b/src/args/arg.rs index 38a63a7d..66916cb9 100644 --- a/src/args/arg.rs +++ b/src/args/arg.rs @@ -2966,6 +2966,7 @@ impl<'a, 'b> Arg<'a, 'b> { /// ``` /// [`Arg::takes_value(true)`]: ./struct.Arg.html#method.takes_value /// [`Arg::default_value`]: ./struct.Arg.html#method.default_value + #[cfg_attr(feature = "lints", allow(explicit_counter_loop))] pub fn default_value_ifs(mut self, ifs: &[(&'a str, Option<&'b str>, &'b str)]) -> Self { self.setb(ArgSettings::TakesValue); if let Some(ref mut vm) = self.default_vals_ifs {