mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
Improving comments.
This commit is contained in:
parent
e6f2239bc3
commit
42d5a07f0c
1 changed files with 1 additions and 2 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue