Skip to content

Commit d1d5f0c

Browse files
committed
inline arms into all callers
1 parent 8519d49 commit d1d5f0c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

clippy_lints/src/matches/match_like_matches.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@ pub(crate) fn check_if_let<'tcx>(
2121
then_expr: &'tcx Expr<'_>,
2222
else_expr: &'tcx Expr<'_>,
2323
) {
24-
let mut arms = [(Some(let_pat), then_expr), (None, else_expr)].into_iter();
2524
if !span_contains_comment(cx.sess().source_map(), expr.span)
2625
&& cx.typeck_results().expr_ty(expr).is_bool()
27-
&& let Some((None, else_expr)) = arms.next_back()
28-
&& let Some((_, first_expr)) = arms.next()
29-
&& let Some(b0) = find_bool_lit(first_expr)
26+
&& let Some(b0) = find_bool_lit(then_expr)
3027
&& let Some(b1) = find_bool_lit(else_expr)
3128
&& b0 != b1
32-
&& arms.all(|(_, expr)| find_bool_lit(expr) == Some(b0))
3329
{
3430
if !is_lint_allowed(cx, REDUNDANT_PATTERN_MATCHING, let_pat.hir_id) && is_some_wild(let_pat.kind) {
3531
return;

0 commit comments

Comments
 (0)