From 9cf007378b9d6408c60f2c9fc00979ccc63ab937 Mon Sep 17 00:00:00 2001 From: Donough Liu Date: Tue, 29 Dec 2020 23:15:50 +0800 Subject: [PATCH] Branch simpification --- src/parse/parser.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/parse/parser.rs b/src/parse/parser.rs index 3062c48b..b4473936 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -367,8 +367,7 @@ impl<'help, 'app> Parser<'help, 'app> { } // Is this a new argument, or a value for previous option? - let starts_new_arg = self.is_new_arg(&arg_os, &needs_val_of); - if starts_new_arg { + if self.is_new_arg(&arg_os, &needs_val_of) { if arg_os == "--" { debug!("Parser::get_matches_with: setting TrailingVals=true"); self.set(AS::TrailingValues); @@ -512,9 +511,7 @@ impl<'help, 'app> Parser<'help, 'app> { )); } - if !self.is_set(AS::TrailingValues) - && (self.is_set(AS::TrailingVarArg) && pos_counter == positional_count) - { + if self.is_set(AS::TrailingVarArg) && pos_counter == positional_count { self.app.settings.set(AS::TrailingValues); } @@ -1003,7 +1000,7 @@ impl<'help, 'app> Parser<'help, 'app> { // maybe here lifetime should be 'a debug!("Parser::parse_long_arg"); - // Update the curent index + // Update the current index self.cur_idx.set(self.cur_idx.get() + 1); debug!("Parser::parse_long_arg: Does it contain '='...");