@@ -255,9 +255,9 @@ 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 ) ]
259- result . push_str ( & if enable_msrv {
260- formatdoc ! (
258+ if enable_msrv {
259+ let _ : fmt :: Result = writedoc ! (
260+ result ,
261261 r"
262262 use clippy_utils::msrvs::{{self, Msrv}};
263263 use clippy_config::Conf;
@@ -266,23 +266,24 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
266266 use rustc_session::impl_lint_pass;
267267
268268 "
269- )
269+ ) ;
270270 } else {
271- formatdoc ! (
271+ let _: fmt:: Result = writedoc ! (
272+ result,
272273 r"
273274 {pass_import}
274275 use rustc_lint::{{{context_import}, {pass_type}}};
275276 use rustc_session::declare_lint_pass;
276277
277278 "
278- )
279- } ) ;
279+ ) ;
280+ }
280281
281282 let _: fmt:: Result = writeln ! ( result, "{}" , get_lint_declaration( & name_upper, category) ) ;
282283
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 ,
286287 r"
287288 pub struct {name_camel} {{
288289 msrv: Msrv,
@@ -303,16 +304,17 @@ fn get_lint_file_contents(lint: &LintData<'_>, enable_msrv: bool) -> String {
303304 // TODO: Add MSRV level to `clippy_config/src/msrvs.rs` if needed.
304305 // TODO: Update msrv config comment in `clippy_config/src/conf.rs`
305306 "
306- )
307+ ) ;
307308 } else {
308- formatdoc ! (
309+ let _: fmt:: Result = writedoc ! (
310+ result,
309311 r"
310312 declare_lint_pass!({name_camel} => [{name_upper}]);
311313
312314 impl {pass_type}{pass_lifetimes} for {name_camel} {{}}
313315 "
314- )
315- } ) ;
316+ ) ;
317+ }
316318
317319 result
318320}
0 commit comments