We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9896c1c commit 1f8a5f2Copy full SHA for 1f8a5f2
clippy_lints/src/matches/try_err.rs
@@ -58,7 +58,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, scrutine
58
let span = hygiene::walk_chain(err_arg.span, try_arg.span.ctxt());
59
let mut applicability = Applicability::MachineApplicable;
60
let origin_snippet = snippet_with_applicability(cx, span, "_", &mut applicability);
61
- let ret_prefix = if get_parent_expr(cx, expr).map_or(false, |e| matches!(e.kind, ExprKind::Ret(_))) {
+ let ret_prefix = if get_parent_expr(cx, expr).is_some_and(|e| matches!(e.kind, ExprKind::Ret(_))) {
62
"" // already returns
63
} else {
64
"return "
0 commit comments