Make ExprField follow single-underscore rules

This commit is contained in:
Devon Hollowood 2015-12-12 21:59:25 -08:00
parent b24e3aeea0
commit 6960bf2ebc

View File

@ -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 {