about summary refs log tree commit diff
path: root/clippy_lints
diff options
context:
space:
mode:
Diffstat (limited to 'clippy_lints')
-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);