From 2767c5d39bcf3c88704a3267a3667f1c9bac192d Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Fri, 28 Dec 2018 14:24:24 +0100 Subject: [PATCH] getopt: cleanup: don't condense 'if' statements too much In a language which enforces curly braces this looks weird and rustfmt doesn't like it. Signed-off-by: Wolfgang Bumiller --- src/getopts.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/getopts.rs b/src/getopts.rs index 3c46c8ce..3e22ecb7 100644 --- a/src/getopts.rs +++ b/src/getopts.rs @@ -79,7 +79,9 @@ pub fn parse_arguments>( if let Schema::Boolean(boolean_schema) = param_schema.as_ref() { want_bool = true; if let Some(default) = boolean_schema.default { - if default == false { can_default = true; } + if default == false { + can_default = true; + } } else { can_default = true; } @@ -93,7 +95,9 @@ pub fn parse_arguments>( let next = args[pos + 1].as_ref(); if let RawArgument::Argument { value: _ } = parse_argument(next) { next_is_argument = true; - if let Ok(_) = parse_boolean(next) { next_is_bool = true; } + if let Ok(_) = parse_boolean(next) { + next_is_bool = true; + } } } @@ -144,7 +148,9 @@ pub fn parse_arguments>( } } - if errors.len() > 0 { return Err(errors); } + if errors.len() > 0 { + return Err(errors); + } if arg_param.len() > 0 { rest = rest[arg_param.len()..].to_vec();