From 1b67e1143f367d00e955c2780dbdefab463836e1 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Thu, 9 Apr 2026 15:13:38 +0800 Subject: Rename DefaultProgram to ThisProgram and remove ThisProgram marker --- mingling_macros/src/pack.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'mingling_macros/src/pack.rs') diff --git a/mingling_macros/src/pack.rs b/mingling_macros/src/pack.rs index a84010e..226dc35 100644 --- a/mingling_macros/src/pack.rs +++ b/mingling_macros/src/pack.rs @@ -69,7 +69,7 @@ pub fn pack(input: TokenStream) -> TokenStream { type_name, inner_type, } => ( - Ident::new("DefaultProgram", proc_macro2::Span::call_site()), + Ident::new("ThisProgram", proc_macro2::Span::call_site()), type_name, inner_type, true, @@ -198,7 +198,7 @@ pub fn pack(input: TokenStream) -> TokenStream { // Combine all implementations let expanded = if use_default { - // For default case, use DefaultProgram + // For default case, use ThisProgram quote! { #struct_def @@ -208,13 +208,13 @@ pub fn pack(input: TokenStream) -> TokenStream { #deref_impl #default_impl - impl Into> for #type_name { - fn into(self) -> mingling::AnyOutput { + impl Into> for #type_name { + fn into(self) -> mingling::AnyOutput { mingling::AnyOutput::new(self) } } - impl From<#type_name> for mingling::ChainProcess { + impl From<#type_name> for mingling::ChainProcess { fn from(value: #type_name) -> Self { mingling::AnyOutput::new(value).route_chain() } @@ -222,19 +222,19 @@ pub fn pack(input: TokenStream) -> TokenStream { impl #type_name { /// Converts the wrapper type into a `ChainProcess` for chaining operations. - pub fn to_chain(self) -> mingling::ChainProcess { + pub fn to_chain(self) -> mingling::ChainProcess { mingling::AnyOutput::new(self).route_chain() } /// Converts the wrapper type into a `ChainProcess` for rendering operations. - pub fn to_render(self) -> mingling::ChainProcess { + pub fn to_render(self) -> mingling::ChainProcess { mingling::AnyOutput::new(self).route_renderer() } } - impl ::mingling::Groupped for #type_name { - fn member_id() -> DefaultProgram { - DefaultProgram::#type_name + impl ::mingling::Groupped for #type_name { + fn member_id() -> ThisProgram { + ThisProgram::#type_name } } } -- cgit