aboutsummaryrefslogtreecommitdiff
path: root/mingling_macros/src/chain.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-04-09 15:13:38 +0800
committer魏曹先生 <1992414357@qq.com>2026-04-09 15:13:38 +0800
commit1b67e1143f367d00e955c2780dbdefab463836e1 (patch)
tree41b93757bba91e2e0eb112d9b5bdb3dfbb3c4c36 /mingling_macros/src/chain.rs
parent4764c3c818e3da16a3cba3b9877d9beb635e4237 (diff)
Rename DefaultProgram to ThisProgram and remove ThisProgram marker
Diffstat (limited to 'mingling_macros/src/chain.rs')
-rw-r--r--mingling_macros/src/chain.rs10
1 files changed, 5 insertions, 5 deletions
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<TypePath> {
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<DefaultProgram> for #struct_name {
+ impl ::mingling::Chain<ThisProgram> for #struct_name {
type Previous = #previous_type;
async fn proc(#prev_param: Self::Previous) ->
- ::mingling::ChainProcess<DefaultProgram>
+ ::mingling::ChainProcess<ThisProgram>
{
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<DefaultProgram>
+ -> ::mingling::ChainProcess<ThisProgram>
{
#fn_body
}