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 4580c8a commit 765cce1Copy full SHA for 765cce1
clippy_lints/src/methods/or_then_unwrap.rs
@@ -39,13 +39,6 @@ pub(super) fn check<'tcx>(
39
return;
40
}
41
42
- let unwrap_span = if let ExprKind::MethodCall(_, _, span) = unwrap_expr.kind {
43
- span
44
- } else {
45
- // unreachable. but fallback to ident's span ("()" are missing)
46
- unwrap_expr.span
47
- };
48
-
49
let mut applicability = Applicability::MachineApplicable;
50
let suggestion = format!(
51
"unwrap_or({})",
@@ -55,7 +48,7 @@ pub(super) fn check<'tcx>(
55
span_lint_and_sugg(
56
cx,
57
OR_THEN_UNWRAP,
58
- or_span.to(unwrap_span),
+ unwrap_expr.span.with_lo(or_span.lo()),
59
52
title,
60
53
"try this",
61
54
suggestion,
0 commit comments