Skip to content

Commit 245e7cf

Browse files
committed
Suppress nonstandard_macro_braces in generated code
1 parent 4bbe3ec commit 245e7cf

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

impl/src/expand.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ fn impl_struct(input: Struct) -> TokenStream {
115115
quote! {
116116
#[allow(unused_qualifications)]
117117
impl #impl_generics std::fmt::Display for #ty #ty_generics #where_clause {
118-
#[allow(clippy::used_underscore_binding)]
118+
#[allow(
119+
// Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422
120+
clippy::nonstandard_macro_braces,
121+
clippy::used_underscore_binding,
122+
)]
119123
fn fmt(&self, __formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
120124
#body
121125
}
@@ -303,7 +307,13 @@ fn impl_enum(input: Enum) -> TokenStream {
303307
impl #impl_generics std::fmt::Display for #ty #ty_generics #where_clause {
304308
fn fmt(&self, __formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
305309
#use_as_display
306-
#[allow(unused_variables, deprecated, clippy::used_underscore_binding)]
310+
#[allow(
311+
unused_variables,
312+
deprecated,
313+
// Clippy bug: https://github.com/rust-lang/rust-clippy/issues/7422
314+
clippy::nonstandard_macro_braces,
315+
clippy::used_underscore_binding,
316+
)]
307317
match #void_deref self {
308318
#(#arms,)*
309319
}

0 commit comments

Comments
 (0)