]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/implicit_saturating_sub.rs
Rollup merge of #83092 - petrochenkov:qspan, r=estebank
[rust.git] / clippy_lints / src / implicit_saturating_sub.rs
index 3a01acd8fdc97a94e779a93ce6b3123d43fd4662..16e162badb5ee64a0172a3e23810490e13e2624b 100644 (file)
@@ -1,4 +1,4 @@
-use crate::utils::{higher, in_macro, match_qpath, span_lint_and_sugg, SpanlessEq};
+use crate::utils::{in_macro, match_qpath, span_lint_and_sugg, SpanlessEq};
 use if_chain::if_chain;
 use rustc_ast::ast::LitKind;
 use rustc_errors::Applicability;
@@ -42,7 +42,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
             return;
         }
         if_chain! {
-            if let Some((ref cond, ref then, None)) = higher::if_block(&expr);
+            if let ExprKind::If(cond, then, None) = &expr.kind;
 
             // Check if the conditional expression is a binary operation
             if let ExprKind::Binary(ref cond_op, ref cond_left, ref cond_right) = cond.kind;