diff --git a/crates/relax-macros/src/lib.rs b/crates/relax-macros/src/lib.rs index 372f2ff..d6da2e2 100644 --- a/crates/relax-macros/src/lib.rs +++ b/crates/relax-macros/src/lib.rs @@ -137,7 +137,14 @@ fn derive_impl(input: syn::DeriveInput) -> syn::Result { if field.attrs.iter().any(|attr| attr.path().is_ident("relax")) { // nested - Ok(quote! { #vis #name: ::std::option::Option<<#ty as Relax>::Partial> }) + match get_generic_ty("Option", ty) { + Some(ty) => { + Ok(quote! { #vis #name: ::std::option::Option<<#ty as Relax>::Partial> }) + } + None => { + Ok(quote! { #vis #name: ::std::option::Option<<#ty as Relax>::Partial> }) + } + } } else { // not nested match get_generic_ty("Option", ty) {