From 42d5a07f0ca4d0a3d17f2d2634862dc73bf82d2f Mon Sep 17 00:00:00 2001 From: daxpedda Date: Tue, 22 Jan 2019 15:23:45 +0100 Subject: [PATCH] Improving comments. --- clippy_lints/src/use_self.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs index 5d4d5bac4..88cf01987 100644 --- a/clippy_lints/src/use_self.rs +++ b/clippy_lints/src/use_self.rs @@ -58,8 +58,7 @@ const SEGMENTS_MSG: &str = "segments should be composed of at least 1 element"; fn span_use_self_lint(cx: &LateContext<'_, '_>, path: &Path) { // path segments only include actual path, no methods or fields 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(..)` + // only take path up to the end of last_path_span let span = path.span.with_hi(last_path_span.hi()); span_lint_and_sugg(