fixed clippy errors

This commit is contained in:
p0lunin 2020-07-03 20:47:03 +03:00
parent f47cd173be
commit 3357bd5947
2 changed files with 3 additions and 4 deletions

View file

@ -19,9 +19,8 @@ impl CommandEnum {
let rename = attrs.rename;
let separator = attrs.separator;
let mut parser = attrs.parser.unwrap_or(ParserType::Default);
match (&mut parser, &separator) {
(ParserType::Split { separator }, Some(s)) => *separator = Some(s.clone()),
_ => {}
if let (ParserType::Split { separator }, Some(s)) = (&mut parser, &separator) {
*separator = Some(s.clone())
}
if let Some(rename_rule) = &rename {
match rename_rule.as_str() {

View file

@ -79,7 +79,7 @@ fn create_parser<'a>(
_ => quote! { compile_error!("Expected 1 argument") },
},
ParserType::Split { separator } => parser_with_separator(
&separator.clone().unwrap_or(" ".to_owned()),
&separator.clone().unwrap_or_else(|| " ".to_owned()),
types,
count_args,
),