Skip to content

Commit 2266152

Browse files
committed
Suppress redundant_field_names clippy lint
warning: redundant field names in struct initialization --> tests/test_from.rs:9:5 | 9 | / #[from] 10 | | source: io::Error, | |__________^ help: replace it with: `source` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names = note: `-W clippy::redundant-field-names` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::redundant_field_names)]` warning: redundant field names in struct initialization --> tests/test_from.rs:32:9 | 32 | / #[from] 33 | | source: io::Error, | |______________^ help: replace it with: `source` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names warning: redundant field names in struct initialization --> tests/test_generics.rs:145:5 | 145 | / #[from] 146 | | pub source: StructDebugGeneric<E>, | |______________^ help: replace it with: `source` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names = note: `-W clippy::redundant-field-names` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::redundant_field_names)]`
1 parent 2901cfd commit 2266152

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

impl/src/expand.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ fn impl_struct(input: Struct) -> TokenStream {
171171
let source_var = Ident::new("source", span);
172172
let body = from_initializer(from_field, backtrace_field, &source_var);
173173
let from_function = quote! {
174+
#[allow(clippy::redundant_field_names)]
174175
fn from(#source_var: #from) -> Self {
175176
#ty #body
176177
}
@@ -453,6 +454,7 @@ fn impl_enum(input: Enum) -> TokenStream {
453454
let source_var = Ident::new("source", span);
454455
let body = from_initializer(from_field, backtrace_field, &source_var);
455456
let from_function = quote! {
457+
#[allow(clippy::redundant_field_names)]
456458
fn from(#source_var: #from) -> Self {
457459
#ty::#variant #body
458460
}

0 commit comments

Comments
 (0)