mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Update non_expressive_names for or patterns
This commit is contained in:
parent
a2477f7759
commit
5e7ff6b705
1 changed files with 3 additions and 2 deletions
|
@ -136,6 +136,9 @@ impl<'a, 'tcx, 'b> Visitor<'tcx> for SimilarNamesNameVisitor<'a, 'tcx, 'b> {
|
|||
}
|
||||
}
|
||||
},
|
||||
// just go through the first pattern, as either all patterns
|
||||
// bind the same bindings or rustc would have errored much earlier
|
||||
PatKind::Or(ref pats) => self.visit_pat(&pats[0]),
|
||||
_ => walk_pat(self, pat),
|
||||
}
|
||||
}
|
||||
|
@ -325,8 +328,6 @@ impl<'a, 'tcx> Visitor<'tcx> for SimilarNamesLocalVisitor<'a, 'tcx> {
|
|||
self.single_char_names.push(vec![]);
|
||||
|
||||
self.apply(|this| {
|
||||
// just go through the first pattern, as either all patterns
|
||||
// bind the same bindings or rustc would have errored much earlier
|
||||
SimilarNamesNameVisitor(this).visit_pat(&arm.pat);
|
||||
this.apply(|this| walk_expr(this, &arm.body));
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue