Skip to content

Commit 36c31db

Browse files
committed
Apply updated needless_raw_strings to Clippy sources
1 parent 5e78c15 commit 36c31db

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

clippy_dev/src/new_lint.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,13 @@ pub(crate) fn get_stabilization_version() -> String {
207207

208208
fn get_test_file_contents(lint_name: &str, msrv: bool) -> String {
209209
let mut test = formatdoc!(
210-
r#"
210+
r"
211211
#![warn(clippy::{lint_name})]
212212
213213
fn main() {{
214214
// test code goes here
215215
}}
216-
"#
216+
"
217217
);
218218

219219
if msrv {
@@ -272,31 +272,31 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
272272

273273
result.push_str(&if enable_msrv {
274274
formatdoc!(
275-
r#"
275+
r"
276276
use clippy_config::msrvs::{{self, Msrv}};
277277
use clippy_config::Conf;
278278
{pass_import}
279279
use rustc_lint::{{{context_import}, {pass_type}, LintContext}};
280280
use rustc_session::impl_lint_pass;
281281
282-
"#
282+
"
283283
)
284284
} else {
285285
formatdoc!(
286-
r#"
286+
r"
287287
{pass_import}
288288
use rustc_lint::{{{context_import}, {pass_type}}};
289289
use rustc_session::declare_lint_pass;
290290
291-
"#
291+
"
292292
)
293293
});
294294

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

297297
result.push_str(&if enable_msrv {
298298
formatdoc!(
299-
r#"
299+
r"
300300
pub struct {name_camel} {{
301301
msrv: Msrv,
302302
}}
@@ -315,15 +315,15 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
315315
316316
// TODO: Add MSRV level to `clippy_config/src/msrvs.rs` if needed.
317317
// TODO: Update msrv config comment in `clippy_config/src/conf.rs`
318-
"#
318+
"
319319
)
320320
} else {
321321
formatdoc!(
322-
r#"
322+
r"
323323
declare_lint_pass!({name_camel} => [{name_upper}]);
324324
325325
impl {pass_type}{pass_lifetimes} for {name_camel} {{}}
326-
"#
326+
"
327327
)
328328
});
329329

@@ -416,7 +416,7 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R
416416
} else {
417417
let _: fmt::Result = writedoc!(
418418
lint_file_contents,
419-
r#"
419+
r"
420420
use rustc_lint::{{{context_import}, LintContext}};
421421
422422
use super::{name_upper};
@@ -425,7 +425,7 @@ fn create_lint_for_ty(lint: &LintData<'_>, enable_msrv: bool, ty: &str) -> io::R
425425
pub(super) fn check(cx: &{context_import}{pass_lifetimes}) {{
426426
todo!();
427427
}}
428-
"#
428+
"
429429
);
430430
}
431431

clippy_lints/src/rc_clone_in_vec_init.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ impl LateLintPass<'_> for RcCloneInVecInit {
6565

6666
fn loop_init_suggestion(elem: &str, len: &str, indent: &str) -> String {
6767
format!(
68-
r#"{{
68+
r"{{
6969
{indent} let mut v = Vec::with_capacity({len});
7070
{indent} (0..{len}).for_each(|_| v.push({elem}));
7171
{indent} v
72-
{indent}}}"#
72+
{indent}}}"
7373
)
7474
}
7575

lintcheck/src/json.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fn print_lint_warnings(lint: &LintWarnings, truncate_after: usize) {
133133
println!();
134134

135135
print!(
136-
r##"{}, {}, {}"##,
136+
r"{}, {}, {}",
137137
count_string(name, "added", lint.added.len()),
138138
count_string(name, "removed", lint.removed.len()),
139139
count_string(name, "changed", lint.changed.len()),

tests/config-metadata.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn book() {
2020

2121
let configs = metadata().map(|conf| conf.to_markdown_paragraph()).join("\n");
2222
let expected = format!(
23-
r#"<!--
23+
r"<!--
2424
This file is generated by `cargo bless --test config-metadata`.
2525
Please use that command to update the file and do not edit it by hand.
2626
-->
@@ -33,7 +33,7 @@ and lints affected.
3333
---
3434
3535
{}
36-
"#,
36+
",
3737
configs.trim(),
3838
);
3939

0 commit comments

Comments
 (0)