Skip to content

Commit 43b866d

Browse files
committed
simplify span_to_remove
1 parent 2bf88ca commit 43b866d

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

clippy_lints/src/let_with_type_underscore.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use clippy_utils::diagnostics::span_lint_and_then;
22
use clippy_utils::is_from_proc_macro;
3-
use clippy_utils::source::{IntoSpan, SpanRangeExt};
43
use rustc_ast::{Local, TyKind};
54
use rustc_errors::Applicability;
65
use rustc_lint::{EarlyContext, EarlyLintPass, LintContext};
@@ -35,10 +34,7 @@ impl EarlyLintPass for UnderscoreTyped {
3534
&& !local.span.in_external_macro(sm)
3635
&& !is_from_proc_macro(cx, &**ty)
3736
{
38-
let span_to_remove = sm
39-
.span_extend_to_prev_char_before(ty.span, ':', true)
40-
.with_leading_whitespace(cx)
41-
.into_span();
37+
let span_to_remove = ty.span.with_lo(local.pat.span.hi());
4238

4339
span_lint_and_then(
4440
cx,

0 commit comments

Comments
 (0)