Skip to content

Commit 0146770

Browse files
committed
fix: simplify condition by checking refutability for inner pattern only
1 parent 6f528d2 commit 0146770

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

clippy_lints/src/loops/manual_flatten.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ pub(super) fn check<'tcx>(
3737
// Ensure expr in `if let` is not used afterwards
3838
&& !is_local_used(cx, if_then, pat_hir_id)
3939
&& msrv.meets(cx, msrvs::ITER_FLATTEN)
40-
&& pats.iter().all(|pat| {
41-
!is_refutable(cx, pat)
42-
})
40+
&& !is_refutable(cx, inner_pat)
4341
{
4442
let if_let_type = if some_ctor { "Some" } else { "Ok" };
4543
// Prepare the error message

0 commit comments

Comments
 (0)