Skip to content

Commit 49ae73b

Browse files
committed
matches: Simplify code
1 parent a0c5087 commit 49ae73b

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

clippy_lints/src/matches.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -877,14 +877,7 @@ fn check_single_match_opt_like(
877877
fn collect_pat_paths(acc: &mut Vec<String>, pat: &Pat<'_>) -> bool {
878878
match pat.kind {
879879
PatKind::Wild => true,
880-
PatKind::Tuple(inner, _) => {
881-
for p in inner {
882-
if !collect_pat_paths(acc, p) {
883-
return false;
884-
}
885-
}
886-
true
887-
},
880+
PatKind::Tuple(inner, _) => inner.iter().all(|p| collect_pat_paths(acc, p)),
888881
PatKind::TupleStruct(ref path, ..) => {
889882
acc.push(rustc_hir_pretty::to_string(rustc_hir_pretty::NO_ANN, |s| {
890883
s.print_qpath(path, false);

0 commit comments

Comments
 (0)