@@ -255,9 +255,9 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
255
255
let name_camel = to_camel_case ( lint. name ) ;
256
256
let name_upper = lint_name. to_uppercase ( ) ;
257
257
258
- # [ expect ( clippy :: format_push_string ) ]
259
- result . push_str ( & if enable_msrv {
260
- formatdoc ! (
258
+ if enable_msrv {
259
+ let _ : fmt :: Result = writedoc ! (
260
+ result ,
261
261
r"
262
262
use clippy_utils::msrvs::{{self, Msrv}};
263
263
use clippy_config::Conf;
@@ -266,23 +266,24 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
266
266
use rustc_session::impl_lint_pass;
267
267
268
268
"
269
- )
269
+ ) ;
270
270
} else {
271
- formatdoc ! (
271
+ let _: fmt:: Result = writedoc ! (
272
+ result,
272
273
r"
273
274
{pass_import}
274
275
use rustc_lint::{{{context_import}, {pass_type}}};
275
276
use rustc_session::declare_lint_pass;
276
277
277
278
"
278
- )
279
- } ) ;
279
+ ) ;
280
+ }
280
281
281
282
let _: fmt:: Result = writeln ! ( result, "{}" , get_lint_declaration( & name_upper, category) ) ;
282
283
283
- # [ expect ( clippy :: format_push_string ) ]
284
- result . push_str ( & if enable_msrv {
285
- formatdoc ! (
284
+ if enable_msrv {
285
+ let _ : fmt :: Result = writedoc ! (
286
+ result ,
286
287
r"
287
288
pub struct {name_camel} {{
288
289
msrv: Msrv,
@@ -303,16 +304,17 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
303
304
// TODO: Add MSRV level to `clippy_config/src/msrvs.rs` if needed.
304
305
// TODO: Update msrv config comment in `clippy_config/src/conf.rs`
305
306
"
306
- )
307
+ ) ;
307
308
} else {
308
- formatdoc ! (
309
+ let _: fmt:: Result = writedoc ! (
310
+ result,
309
311
r"
310
312
declare_lint_pass!({name_camel} => [{name_upper}]);
311
313
312
314
impl {pass_type}{pass_lifetimes} for {name_camel} {{}}
313
315
"
314
- )
315
- } ) ;
316
+ ) ;
317
+ }
316
318
317
319
result
318
320
}
0 commit comments