Improve span shortening.
Co-Authored-By: daxpedda <1645124+daxpedda@users.noreply.github.com>
This commit is contained in:
parent
2e0977f3b4
commit
e70f9456fc
@ -60,7 +60,7 @@ fn span_use_self_lint(cx: &LateContext<'_, '_>, path: &Path) {
|
||||
let last_path_span = path.segments.last().expect(SEGMENTS_MSG).ident.span;
|
||||
// `to()` doesn't shorten span, so we shorten it with `until(..)`
|
||||
// and then include it with `to(..)`
|
||||
let span = path.span.until(last_path_span).to(last_path_span);
|
||||
let span = path.span.with_hi(last_path_span.hi());
|
||||
|
||||
span_lint_and_sugg(
|
||||
cx,
|
||||
|
Loading…
x
Reference in New Issue
Block a user