Skip to content

Commit

Permalink
Fix question_mark.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed May 11, 2019
1 parent 53ed92a commit a8d8bb0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/question_mark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit a8d8bb0

Please sign in to comment.