Improve span shortening.

Co-Authored-By: daxpedda <1645124+daxpedda@users.noreply.github.com>
This commit is contained in:
Philipp Krones 2019-01-22 14:43:59 +01:00 committed by GitHub
parent 2e0977f3b4
commit e70f9456fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,