From 350eabe84e0f65c674af221d4e557a948b3dd8c8 Mon Sep 17 00:00:00 2001 From: Hasan Mohsin <hasan@hasali.dev> Date: Tue, 5 Mar 2024 08:15:30 +0000 Subject: [PATCH] Fix missing generics on impl for EnumTryAs --- strum_macros/src/macros/enum_try_as.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/strum_macros/src/macros/enum_try_as.rs b/strum_macros/src/macros/enum_try_as.rs index 1efbbe8f..c6d0127c 100644 --- a/strum_macros/src/macros/enum_try_as.rs +++ b/strum_macros/src/macros/enum_try_as.rs @@ -10,6 +10,7 @@ pub fn enum_try_as_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { }; let enum_name = &ast.ident; + let (impl_generics, ty_generics, where_clause) = ast.generics.split_for_impl(); let variants: Vec<_> = variants .iter() @@ -72,9 +73,8 @@ pub fn enum_try_as_inner(ast: &DeriveInput) -> syn::Result<TokenStream> { .collect(); Ok(quote! { - impl #enum_name { + impl #impl_generics #enum_name #ty_generics #where_clause { #(#variants)* } - } - .into()) + }) }