Skip to content

Commit 2d9e67e

Browse files
committed
manual_let_else: Delay msrv and macro checks.
1 parent 95348ad commit 2d9e67e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clippy_lints/src/manual_let_else.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,14 @@ declare_clippy_lint! {
4949

5050
impl<'tcx> QuestionMark {
5151
pub(crate) fn check_manual_let_else(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'tcx>) {
52-
if !self.msrv.meets(msrvs::LET_ELSE) || in_external_macro(cx.sess(), stmt.span) {
53-
return;
54-
}
55-
5652
if let StmtKind::Let(local) = stmt.kind
5753
&& let Some(init) = local.init
5854
&& local.els.is_none()
5955
&& local.ty.is_none()
6056
&& init.span.eq_ctxt(stmt.span)
6157
&& let Some(if_let_or_match) = IfLetOrMatch::parse(cx, init)
58+
&& self.msrv.meets(msrvs::LET_ELSE)
59+
&& !in_external_macro(cx.sess(), stmt.span)
6260
{
6361
match if_let_or_match {
6462
IfLetOrMatch::IfLet(if_let_expr, let_pat, if_then, if_else, ..) => {

0 commit comments

Comments
 (0)