Improving comments.

This commit is contained in:
daxpedda 2019-01-22 15:23:45 +01:00
parent e6f2239bc3
commit 42d5a07f0c
No known key found for this signature in database
GPG key ID: C722DCB6A191EEAB

View file

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