We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e6f2239 commit 42d5a07Copy full SHA for 42d5a07
clippy_lints/src/use_self.rs
@@ -58,8 +58,7 @@ const SEGMENTS_MSG: &str = "segments should be composed of at least 1 element";
58
fn span_use_self_lint(cx: &LateContext<'_, '_>, path: &Path) {
59
// path segments only include actual path, no methods or fields
60
let last_path_span = path.segments.last().expect(SEGMENTS_MSG).ident.span;
61
- // `to()` doesn't shorten span, so we shorten it with `until(..)`
62
- // and then include it with `to(..)`
+ // only take path up to the end of last_path_span
63
let span = path.span.with_hi(last_path_span.hi());
64
65
span_lint_and_sugg(
0 commit comments