From 0426913ca95d457abefb192cde878d9eaab4b8a0 Mon Sep 17 00:00:00 2001 From: Kisaragi Marine Date: Tue, 28 Nov 2023 00:40:13 +0900 Subject: [PATCH] fix dogfood --- clippy_lints/src/redundant_closure_call.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/clippy_lints/src/redundant_closure_call.rs b/clippy_lints/src/redundant_closure_call.rs index 17a17890b..8bac2e40e 100644 --- a/clippy_lints/src/redundant_closure_call.rs +++ b/clippy_lints/src/redundant_closure_call.rs @@ -176,16 +176,15 @@ impl<'tcx> LateLintPass<'tcx> for RedundantClosureCall { hint = hint.asyncify(); } - let is_in_fn_call_arg = clippy_utils::get_parent_node(cx.tcx, expr.hir_id) - .map(|x| match x { + let is_in_fn_call_arg = + clippy_utils::get_parent_node(cx.tcx, expr.hir_id).is_some_and(|x| match x { Node::Expr(expr) => matches!(expr.kind, hir::ExprKind::Call(_, _)), _ => false, - }) - .unwrap_or(false); + }); // avoid clippy::double_parens if !is_in_fn_call_arg { - hint = hint.maybe_par() + hint = hint.maybe_par(); }; diag.span_suggestion(full_expr.span, "try doing something like", hint, applicability);