Skip to content

Commit 7ece69d

Browse files
committed
always return Break for rest pattern
1 parent 1fbf8f8 commit 7ece69d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clippy_lints/src/matches/redundant_guard.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,8 @@ fn expr_can_be_pat(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
224224
}
225225
}
226226

227-
if let Some(rest) = rest {
228-
if !helper(cx, rest) {
229-
return ControlFlow::Break(());
230-
}
227+
if rest.is_some() {
228+
return ControlFlow::Break(());
231229
}
232230

233231
true

0 commit comments

Comments
 (0)