mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
chore: clippy run
This commit is contained in:
parent
fabe9267ee
commit
c20701b74a
2 changed files with 5 additions and 6 deletions
|
@ -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,16 +1791,14 @@ 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() {
|
||||
if v == val && matcher.get(r).is_none() {
|
||||
return self.missing_required_error(matcher);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue