We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e534f3e commit c150da9Copy full SHA for c150da9
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