Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
BeatButton authored and TeXitoi committed Sep 20, 2019
1 parent 1cae9fa commit 0c888e9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions structopt-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,17 +290,15 @@ fn gen_constructor(fields: &Punctuated<Field, Comma>, parent_attribute: &Attrs)
Ty::OptionVec => quote_spanned! { ty.span()=>
if matches.is_present(#name) {
Some(matches.#values_of(#name)
.map(|v| v.map(#parse).collect())
.unwrap_or_else(Vec::new))
.map_or_else(Vec::new, |v| v.map(#parse).collect()))
} else {
None
}
},

Ty::Vec => quote_spanned! { ty.span()=>
matches.#values_of(#name)
.map(|v| v.map(#parse).collect())
.unwrap_or_else(Vec::new)
.map_or_else(Vec::new, |v| v.map(#parse).collect())
},

Ty::Other if occurrences => quote_spanned! { ty.span()=>
Expand Down

0 comments on commit 0c888e9

Please sign in to comment.