Skip to content

Commit 1c4dd8d

Browse files
committed
Remove trim_semicolon
1 parent 445c83f commit 1c4dd8d

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

clippy_lints/src/format_args.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_lint::{LateContext, LateLintPass};
1010
use rustc_middle::ty::adjustment::{Adjust, Adjustment};
1111
use rustc_middle::ty::Ty;
1212
use rustc_session::{declare_lint_pass, declare_tool_lint};
13-
use rustc_span::{sym, BytePos, ExpnData, ExpnKind, Span, Symbol};
13+
use rustc_span::{sym, ExpnData, ExpnKind, Span, Symbol};
1414

1515
declare_clippy_lint! {
1616
/// ### What it does
@@ -128,7 +128,7 @@ fn check_format_in_format_args(cx: &LateContext<'_>, call_site: Span, name: Symb
128128
span_lint_and_then(
129129
cx,
130130
FORMAT_IN_FORMAT_ARGS,
131-
trim_semicolon(cx, call_site),
131+
call_site,
132132
&format!("`format!` in `{}!` args", name),
133133
|diag| {
134134
diag.help(&format!(
@@ -192,13 +192,6 @@ fn is_aliased(args: &[FormatArgsArg<'_>], i: usize) -> bool {
192192
.any(|(j, arg)| i != j && std::ptr::eq(value, arg.value))
193193
}
194194

195-
fn trim_semicolon(cx: &LateContext<'_>, span: Span) -> Span {
196-
snippet_opt(cx, span).map_or(span, |snippet| {
197-
let snippet = snippet.trim_end_matches(';');
198-
span.with_hi(span.lo() + BytePos(u32::try_from(snippet.len()).unwrap()))
199-
})
200-
}
201-
202195
fn count_needed_derefs<'tcx, I>(mut ty: Ty<'tcx>, mut iter: I) -> (usize, Ty<'tcx>)
203196
where
204197
I: Iterator<Item = &'tcx Adjustment<'tcx>>,

0 commit comments

Comments
 (0)