Skip to content

Commit 4931f45

Browse files
committed
Split if conditions by its semantics
1 parent a408e76 commit 4931f45

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

clippy_lints/src/manual_let_else.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ impl_lint_pass!(ManualLetElse => [MANUAL_LET_ELSE]);
6868

6969
impl<'tcx> LateLintPass<'tcx> for ManualLetElse {
7070
fn check_stmt(&mut self, cx: &LateContext<'_>, stmt: &'tcx Stmt<'tcx>) {
71-
if self.msrv.meets(msrvs::LET_ELSE) &&
72-
!in_external_macro(cx.sess(), stmt.span) &&
73-
let StmtKind::Local(local) = stmt.kind &&
71+
if !self.msrv.meets(msrvs::LET_ELSE) || in_external_macro(cx.sess(), stmt.span) {
72+
return;
73+
}
74+
75+
if let StmtKind::Local(local) = stmt.kind &&
7476
let Some(init) = local.init &&
7577
local.els.is_none() &&
7678
local.ty.is_none() &&

0 commit comments

Comments
 (0)