diff options
| author | Kisaragi Marine <kisaragi.effective@gmail.com> | 2023-11-28 00:40:13 +0900 |
|---|---|---|
| committer | Kisaragi Marine <kisaragi.effective@gmail.com> | 2023-11-28 00:40:13 +0900 |
| commit | 0426913ca95d457abefb192cde878d9eaab4b8a0 (patch) | |
| tree | 8279fa24a96e652b662bf56b791408c7e2b19bce | |
| parent | 33182495ac8045af2b20210dd628690c52332e44 (diff) | |
| download | rust-0426913ca95d457abefb192cde878d9eaab4b8a0.tar.gz rust-0426913ca95d457abefb192cde878d9eaab4b8a0.zip | |
fix dogfood
| -rw-r--r-- | clippy_lints/src/redundant_closure_call.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clippy_lints/src/redundant_closure_call.rs b/clippy_lints/src/redundant_closure_call.rs index 17a17890be7..8bac2e40e01 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); |
