Skip to content

Commit

Permalink
fix cargo clippy complaint (collapsible_if)
Browse files Browse the repository at this point in the history
  • Loading branch information
rivy committed May 21, 2020
1 parent 95c7521 commit 8489bf3
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1278,23 +1278,22 @@ where
&*Usage::new(self).create_usage_with_title(&[]),
self.app.color(),
)?);
} else if needs_eq && min_vals_zero {
debug!("None and requires equals, but min_vals == 0");
if !opt.default_missing_vals.is_empty() {
debug!("Parser::parse_opt: has default_missing_vals");
for val in &opt.default_missing_vals {
debug!("Parser::parse_opt: adding value from default_missing_values; val = {:?}", val);
self.add_val_to_arg(
opt,
&ArgStr::new(val),
matcher,
ValueType::CommandLine,
)?;
}
};
} else {
debug!("None");
if needs_eq && min_vals_zero {
// OPTION with missing optional value?
if !opt.default_missing_vals.is_empty() {
debug!("Parser::parse_opt: has default_missing_vals");
for val in &opt.default_missing_vals {
debug!("Parser::parse_opt: adding value from default_missing_values; val = {:?}", val);
self.add_val_to_arg(
opt,
&ArgStr::new(val),
matcher,
ValueType::CommandLine,
)?;
}
};
}
}

matcher.inc_occurrence_of(&opt.id);
Expand Down

0 comments on commit 8489bf3

Please sign in to comment.