diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-04-20 14:06:38 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-04-20 14:06:38 +0800 |
| commit | 6f66a3158f4a4b2bca42ec385abefbf4011618cc (patch) | |
| tree | 2f5193e9130c6477e413d90966babc2d60721182 /mingling_macros/src/pack.rs | |
| parent | 2036fb58275d7fddad9c27bcceb780e8f715e5c0 (diff) | |
Move type registration to pack! and Groupped macros
Diffstat (limited to 'mingling_macros/src/pack.rs')
| -rw-r--r-- | mingling_macros/src/pack.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mingling_macros/src/pack.rs b/mingling_macros/src/pack.rs index 226dc35..9da16de 100644 --- a/mingling_macros/src/pack.rs +++ b/mingling_macros/src/pack.rs @@ -162,6 +162,10 @@ pub fn pack(input: TokenStream) -> TokenStream { } }; + let register_impl = quote! { + ::mingling::macros::register_type!(#type_name); + }; + let any_out_impl = quote! { impl Into<mingling::AnyOutput<#group_name>> for #type_name { fn into(self) -> mingling::AnyOutput<#group_name> { @@ -207,6 +211,7 @@ pub fn pack(input: TokenStream) -> TokenStream { #as_ref_impl #deref_impl #default_impl + #register_impl impl Into<mingling::AnyOutput<ThisProgram>> for #type_name { fn into(self) -> mingling::AnyOutput<ThisProgram> { @@ -248,6 +253,7 @@ pub fn pack(input: TokenStream) -> TokenStream { #as_ref_impl #deref_impl #default_impl + #register_impl #any_out_impl #group_impl |
