Skip to content

Commit 5e7ff6b

Browse files
committed
Update non_expressive_names for or patterns
1 parent a2477f7 commit 5e7ff6b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clippy_lints/src/non_expressive_names.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ impl<'a, 'tcx, 'b> Visitor<'tcx> for SimilarNamesNameVisitor<'a, 'tcx, 'b> {
136136
}
137137
}
138138
},
139+
// just go through the first pattern, as either all patterns
140+
// bind the same bindings or rustc would have errored much earlier
141+
PatKind::Or(ref pats) => self.visit_pat(&pats[0]),
139142
_ => walk_pat(self, pat),
140143
}
141144
}
@@ -325,8 +328,6 @@ impl<'a, 'tcx> Visitor<'tcx> for SimilarNamesLocalVisitor<'a, 'tcx> {
325328
self.single_char_names.push(vec![]);
326329

327330
self.apply(|this| {
328-
// just go through the first pattern, as either all patterns
329-
// bind the same bindings or rustc would have errored much earlier
330331
SimilarNamesNameVisitor(this).visit_pat(&arm.pat);
331332
this.apply(|this| walk_expr(this, &arm.body));
332333
});

0 commit comments

Comments
 (0)