Skip to content

Commit a7adb82

Browse files
committed
Move format_push_string and format_collect to pedantic
1 parent c8ba3e1 commit a7adb82

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

clippy_dev/src/new_lint.rs

+2
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
255255
let name_camel = to_camel_case(lint.name);
256256
let name_upper = lint_name.to_uppercase();
257257

258+
#[expect(clippy::format_push_string)]
258259
result.push_str(&if enable_msrv {
259260
formatdoc!(
260261
r"
@@ -279,6 +280,7 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
279280

280281
let _: fmt::Result = writeln!(result, "{}", get_lint_declaration(&name_upper, category));
281282

283+
#[expect(clippy::format_push_string)]
282284
result.push_str(&if enable_msrv {
283285
formatdoc!(
284286
r"

clippy_lints/src/endian_bytes.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use rustc_middle::lint::in_external_macro;
77
use rustc_middle::ty::Ty;
88
use rustc_session::declare_lint_pass;
99
use rustc_span::Symbol;
10+
use std::fmt::Write;
1011

1112
declare_clippy_lint! {
1213
/// ### What it does
@@ -184,7 +185,7 @@ fn maybe_lint_endian_bytes(cx: &LateContext<'_>, expr: &Expr<'_>, prefix: Prefix
184185
help_str.push_str("either of ");
185186
}
186187

187-
help_str.push_str(&format!("`{ty}::{}` ", lint.as_name(prefix)));
188+
write!(help_str, "`{ty}::{}` ", lint.as_name(prefix)).unwrap();
188189

189190
if i != len && !only_one {
190191
help_str.push_str("or ");

clippy_lints/src/format_push_string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ declare_clippy_lint! {
3535
/// ```
3636
#[clippy::version = "1.62.0"]
3737
pub FORMAT_PUSH_STRING,
38-
restriction,
38+
pedantic,
3939
"`format!(..)` appended to existing `String`"
4040
}
4141
declare_lint_pass!(FormatPushString => [FORMAT_PUSH_STRING]);

clippy_lints/src/methods/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3514,7 +3514,7 @@ declare_clippy_lint! {
35143514
/// ```
35153515
#[clippy::version = "1.73.0"]
35163516
pub FORMAT_COLLECT,
3517-
perf,
3517+
pedantic,
35183518
"`format!`ing every element in a collection, then collecting the strings into a new `String`"
35193519
}
35203520

0 commit comments

Comments
 (0)