Skip to content

Commit

Permalink
style: Make clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed May 31, 2022
1 parent 12d145c commit 8af7294
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ impl<'help, 'cmd> Parser<'help, 'cmd> {
// Assume this is a value of a previous arg.

// get the option so we can check the settings
let arg_values = matcher.pending_values_mut(&id, None);
let arg_values = matcher.pending_values_mut(id, None);
let arg = &self.cmd[id];
let parse_result = self.push_arg_values(
arg,
Expand Down Expand Up @@ -1144,17 +1144,15 @@ impl<'help, 'cmd> Parser<'help, 'cmd> {
&& matcher.contains(&arg.id)
{
// HACK: Reuse existing occurrence
} else {
if source == ValueSource::CommandLine {
if matches!(ident, Some(Identifier::Short) | Some(Identifier::Long)) {
// Record flag's index
self.cur_idx.set(self.cur_idx.get() + 1);
debug!("Parser::react: cur_idx:={}", self.cur_idx.get());
}
self.start_occurrence_of_arg(matcher, arg);
} else {
self.start_custom_arg(matcher, arg, source);
} else if source == ValueSource::CommandLine {
if matches!(ident, Some(Identifier::Short) | Some(Identifier::Long)) {
// Record flag's index
self.cur_idx.set(self.cur_idx.get() + 1);
debug!("Parser::react: cur_idx:={}", self.cur_idx.get());
}
self.start_occurrence_of_arg(matcher, arg);
} else {
self.start_custom_arg(matcher, arg, source);
}
self.store_arg_values(arg, raw_vals, matcher)?;
if ident == Some(Identifier::Index) && arg.is_multiple_values_set() {
Expand Down

0 comments on commit 8af7294

Please sign in to comment.