]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/if_then_some_else_none.rs
Rollup merge of #89789 - jkugelman:must-use-thread-builder, r=joshtriplett
[rust.git] / src / tools / clippy / clippy_lints / src / if_then_some_else_none.rs
index 17b9a2f888e0d1fa86ecfdc9ce2e371e11ddf5ef..a2dac57454f2d3b7430d4127c70dec75b1952e64 100644 (file)
@@ -1,6 +1,6 @@
 use clippy_utils::diagnostics::span_lint_and_help;
 use clippy_utils::source::snippet_with_macro_callsite;
-use clippy_utils::{is_else_clause, is_lang_ctor, meets_msrv, msrvs};
+use clippy_utils::{higher, is_else_clause, is_lang_ctor, meets_msrv, msrvs};
 use if_chain::if_chain;
 use rustc_hir::LangItem::{OptionNone, OptionSome};
 use rustc_hir::{Expr, ExprKind};
@@ -70,7 +70,7 @@ fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'tcx Expr<'_>) {
         }
 
         if_chain! {
-            if let ExprKind::If(cond, then, Some(els)) = expr.kind;
+            if let Some(higher::If { cond, then, r#else: Some(els) }) = higher::If::hir(expr);
             if let ExprKind::Block(then_block, _) = then.kind;
             if let Some(then_expr) = then_block.expr;
             if let ExprKind::Call(then_call, [then_arg]) = then_expr.kind;