Skip to content

Commit a445ab7

Browse files
committed
Fix question_mark.rs
1 parent 73b03b5 commit a445ab7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/question_mark.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use syntax::ptr::P;
88

99
use crate::utils::paths::*;
1010
use crate::utils::sugg::Sugg;
11-
use crate::utils::{match_type, span_lint_and_then, SpanlessEq};
11+
use crate::utils::{higher, match_type, span_lint_and_then, SpanlessEq};
1212

1313
declare_clippy_lint! {
1414
/// **What it does:** Checks for expressions that could be replaced by the question mark operator.
@@ -48,7 +48,7 @@ impl QuestionMark {
4848
/// If it matches, it will suggest to use the question mark operator instead
4949
fn check_is_none_and_early_return_none(cx: &LateContext<'_, '_>, expr: &Expr) {
5050
if_chain! {
51-
if let ExprKind::If(if_expr, body, else_) = &expr.node;
51+
if let Some((if_expr, body, else_)) = higher::if_block(&expr);
5252
if let ExprKind::MethodCall(segment, _, args) = &if_expr.node;
5353
if segment.ident.name == "is_none";
5454
if Self::expression_returns_none(cx, body);

0 commit comments

Comments
 (0)