diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2019-05-10 19:18:17 -0700 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2019-05-10 23:40:42 -0700 |
| commit | 09a93291ec1f97e27e9da17e5fb9f993ae5b7f21 (patch) | |
| tree | 3b1adc0bc3cd4bfce49af1a6e18210a9536b6540 | |
| parent | f40c77a77665e3f54c2e0d02e074033768a87576 (diff) | |
| download | rust-09a93291ec1f97e27e9da17e5fb9f993ae5b7f21.tar.gz rust-09a93291ec1f97e27e9da17e5fb9f993ae5b7f21.zip | |
Fix question_mark.rs
| -rw-r--r-- | clippy_lints/src/question_mark.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/question_mark.rs b/clippy_lints/src/question_mark.rs index 9377ff3e3a0..743c0c4224a 100644 --- a/clippy_lints/src/question_mark.rs +++ b/clippy_lints/src/question_mark.rs @@ -8,7 +8,7 @@ use syntax::ptr::P; use crate::utils::paths::*; use crate::utils::sugg::Sugg; -use crate::utils::{match_type, span_lint_and_then, SpanlessEq}; +use crate::utils::{higher, match_type, span_lint_and_then, SpanlessEq}; declare_clippy_lint! { /// **What it does:** Checks for expressions that could be replaced by the question mark operator. @@ -48,7 +48,7 @@ impl QuestionMark { /// If it matches, it will suggest to use the question mark operator instead fn check_is_none_and_early_return_none(cx: &LateContext<'_, '_>, expr: &Expr) { if_chain! { - if let ExprKind::If(if_expr, body, else_) = &expr.node; + if let Some((if_expr, body, else_)) = higher::if_block(&expr); if let ExprKind::MethodCall(segment, _, args) = &if_expr.node; if segment.ident.name == "is_none"; if Self::expression_returns_none(cx, body); |
