about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKisaragi Marine <kisaragi.effective@gmail.com>2023-11-28 00:40:13 +0900
committerKisaragi Marine <kisaragi.effective@gmail.com>2023-11-28 00:40:13 +0900
commit0426913ca95d457abefb192cde878d9eaab4b8a0 (patch)
tree8279fa24a96e652b662bf56b791408c7e2b19bce
parent33182495ac8045af2b20210dd628690c52332e44 (diff)
downloadrust-0426913ca95d457abefb192cde878d9eaab4b8a0.tar.gz
rust-0426913ca95d457abefb192cde878d9eaab4b8a0.zip
fix dogfood
-rw-r--r--clippy_lints/src/redundant_closure_call.rs9
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);