File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -181,12 +181,19 @@ fn impl_struct(input: Struct) -> TokenStream {
181181 #from_function
182182 }
183183 } ;
184+ let lint_allows = if input. generics . lifetimes ( ) . next ( ) . is_some ( ) {
185+ quote ! {
186+ clippy:: elidable_lifetime_names,
187+ clippy:: needless_lifetimes,
188+ }
189+ } else {
190+ quote ! ( )
191+ } ;
184192 Some ( quote ! {
185193 #[ allow(
186194 deprecated,
187195 unused_qualifications,
188- clippy:: elidable_lifetime_names,
189- clippy:: needless_lifetimes,
196+ #lint_allows
190197 ) ]
191198 #from_impl
192199 } )
@@ -456,12 +463,19 @@ fn impl_enum(input: Enum) -> TokenStream {
456463 #from_function
457464 }
458465 } ;
466+ let lint_allows = if input. generics . lifetimes ( ) . next ( ) . is_some ( ) {
467+ quote ! {
468+ clippy:: elidable_lifetime_names,
469+ clippy:: needless_lifetimes,
470+ }
471+ } else {
472+ quote ! ( )
473+ } ;
459474 Some ( quote ! {
460475 #[ allow(
461476 deprecated,
462477 unused_qualifications,
463- clippy:: elidable_lifetime_names,
464- clippy:: needless_lifetimes,
478+ #lint_allows
465479 ) ]
466480 #from_impl
467481 } )
You can’t perform that action at this time.
0 commit comments