mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-20 19:04:21 +00:00
Make ExprField follow single-underscore rules
This commit is contained in:
parent
b24e3aeea0
commit
6960bf2ebc
@ -368,7 +368,11 @@ impl LateLintPass for UsedUnderscoreBinding {
|
||||
_ => false
|
||||
}) //local variable
|
||||
},
|
||||
ExprField(_, spanned) => spanned.node.as_str().chars().next() == Some('_'),
|
||||
ExprField(_, spanned) => {
|
||||
let name = spanned.node.as_str();
|
||||
name.chars().next() == Some('_')
|
||||
&& name.chars().skip(1).next() != Some('_')
|
||||
},
|
||||
_ => false
|
||||
};
|
||||
if needs_lint {
|
||||
|
Loading…
Reference in New Issue
Block a user