Skip to content

Commit e70f945

Browse files
flip1995daxpedda
andauthored
Improve span shortening.
Co-Authored-By: daxpedda <[email protected]>
1 parent 2e0977f commit e70f945

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/use_self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn span_use_self_lint(cx: &LateContext<'_, '_>, path: &Path) {
6060
let last_path_span = path.segments.last().expect(SEGMENTS_MSG).ident.span;
6161
// `to()` doesn't shorten span, so we shorten it with `until(..)`
6262
// and then include it with `to(..)`
63-
let span = path.span.until(last_path_span).to(last_path_span);
63+
let span = path.span.with_hi(last_path_span.hi());
6464

6565
span_lint_and_sugg(
6666
cx,

0 commit comments

Comments
 (0)