Skip to content

Commit

Permalink
Resolve clippy collapsible_if lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Nov 10, 2020
1 parent 97cd2b7 commit 466556e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ pub fn expand_attr(
let group = match tokens.next() {
Some(TokenTree::Punct(ref punct)) if punct.as_char() == '=' => {
let mut count = 0;
if tokens.inspect(|_| count += 1).all(|tt| is_stringlike(&tt)) {
if count > 1 {
*contains_paste = true;
return do_paste_name_value_attr(attr, span);
}
if tokens.inspect(|_| count += 1).all(|tt| is_stringlike(&tt)) && count > 1 {
*contains_paste = true;
return do_paste_name_value_attr(attr, span);
}
return Ok(attr);
}
Expand Down

0 comments on commit 466556e

Please sign in to comment.