]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/question_mark.rs
Merge commit '2b2190cb5667cdd276a24ef8b9f3692209c54a89' into clippyup
[rust.git] / src / tools / clippy / clippy_lints / src / question_mark.rs
index fd0a53839e6eaa2f7e6c3f9955711bfeb94834bc..964a057f00d32e5c1da41c7a4d1b7a3525710f0c 100644 (file)
@@ -86,8 +86,7 @@ fn check_is_none_or_err_and_early_return<'tcx>(cx: &LateContext<'tcx>, expr: &Ex
     if_chain! {
         if let Some(higher::If { cond, then, r#else }) = higher::If::hir(expr);
         if !is_else_clause(cx.tcx, expr);
-        if let ExprKind::MethodCall(segment, args, _) = &cond.kind;
-        if let Some(caller) = args.get(0);
+        if let ExprKind::MethodCall(segment, [caller, ..], _) = &cond.kind;
         let caller_ty = cx.typeck_results().expr_ty(caller);
         let if_block = IfBlockType::IfIs(caller, caller_ty, segment.ident.name, then, r#else);
         if is_early_return(sym::Option, cx, &if_block) || is_early_return(sym::Result, cx, &if_block);