From 47e8464d3d35b21c0dcf1facf92f21e202b70a94 Mon Sep 17 00:00:00 2001 From: llogiq Date: Sun, 11 Oct 2020 19:40:27 +0200 Subject: [PATCH] Update clippy_lints/src/functions.rs Co-authored-by: Eduardo Broto --- clippy_lints/src/functions.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clippy_lints/src/functions.rs b/clippy_lints/src/functions.rs index 63f5425b2059..dcdc1d0f9f48 100644 --- a/clippy_lints/src/functions.rs +++ b/clippy_lints/src/functions.rs @@ -458,8 +458,7 @@ fn check_result_unit_err(cx: &LateContext<'_>, decl: &hir::FnDecl<'_>, item_span if let hir::TyKind::Path(ref qpath) = ty.kind { if is_type_diagnostic_item(cx, hir_ty_to_ty(cx.tcx, ty), sym!(result_type)) { if let Some(ref args) = last_path_segment(qpath).args { - if args.args.len() == 2 { - if let hir::GenericArg::Type(ref err_ty) = args.args[1] { + if let [_, hir::GenericArg::Type(ref err_ty)] = args.args { if let hir::TyKind::Tup(t) = err_ty.kind { if t.is_empty() { span_lint_and_help(