Skip to content

Commit e71d2ba

Browse files
committed
Get rid of another handwritten Span construtor in favour of a builtin function
1 parent a8cf4e8 commit e71d2ba

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

clippy_lints/src/if_let_redundant_pattern_matching.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
7474
arms[0].pats[0].span,
7575
&format!("redundant pattern matching, consider using `{}`", good_method),
7676
|db| {
77-
let span = Span::new(
78-
expr.span.lo(),
79-
op.span.hi(),
80-
expr.span.ctxt(),
81-
);
77+
let span = expr.span.with_hi(op.span.hi());
8278
db.span_suggestion(span, "try this", format!("if {}.{}", snippet(cx, op.span, "_"), good_method));
8379
});
8480
}

0 commit comments

Comments
 (0)