Simplify the code

This commit is contained in:
Sergey Isaev 2020-08-05 01:09:02 +03:00
parent 0495fc90c3
commit e09df32666

View File

@ -33,11 +33,7 @@ impl CLI for NewCommand {
#[cfg_attr(tarpaulin, skip)]
fn parse(arguments: &ArgMatches) -> Result<Self::Options, CLIError> {
let mut is_lib = false;
if arguments.is_present("lib") {
is_lib = true;
}
let is_lib = arguments.is_present("lib");
match arguments.value_of("NAME") {
Some(name) => Ok((Some(name.to_string()), is_lib)),
None => Ok((None, is_lib)),