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/chain.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mingling_macros/src/chain.rs') diff --git a/mingling_macros/src/chain.rs b/mingling_macros/src/chain.rs index 7b519a1..924931e 100644 --- a/mingling_macros/src/chain.rs +++ b/mingling_macros/src/chain.rs @@ -61,10 +61,10 @@ fn extract_return_type(sig: &Signature) -> syn::Result { pub fn chain_attr(attr: TokenStream, item: TokenStream) -> TokenStream { // Parse the attribute arguments (e.g., MyProgram from #[chain(MyProgram)]) - // If no argument is provided, use DefaultProgram + // If no argument is provided, use ThisProgram let (group_name, use_crate_prefix) = if attr.is_empty() { ( - Ident::new("DefaultProgram", proc_macro2::Span::call_site()), + Ident::new("ThisProgram", proc_macro2::Span::call_site()), true, ) } else { @@ -128,11 +128,11 @@ pub fn chain_attr(attr: TokenStream, item: TokenStream) -> TokenStream { #(#fn_attrs)* #vis struct #struct_name; - impl ::mingling::Chain for #struct_name { + impl ::mingling::Chain for #struct_name { type Previous = #previous_type; async fn proc(#prev_param: Self::Previous) -> - ::mingling::ChainProcess + ::mingling::ChainProcess { let _ = NextProcess; // Call the original function @@ -143,7 +143,7 @@ pub fn chain_attr(attr: TokenStream, item: TokenStream) -> TokenStream { // Keep the original function for internal use #(#fn_attrs)* #vis async fn #fn_name(#prev_param: #previous_type) - -> ::mingling::ChainProcess + -> ::mingling::ChainProcess { #fn_body } -- cgit