From d7c9ad94113cca2f782666e37a0aa4fb7b8d7d86 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 22 Jun 2026 20:21:41 +0800 Subject: Support qualified type paths in four macros --- mingling_macros/src/chain.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mingling_macros/src/chain.rs') diff --git a/mingling_macros/src/chain.rs b/mingling_macros/src/chain.rs index fb5999a..eaf43fb 100644 --- a/mingling_macros/src/chain.rs +++ b/mingling_macros/src/chain.rs @@ -377,15 +377,17 @@ pub fn chain_attr(attr: TokenStream, item: TokenStream) -> TokenStream { /// Builds a match arm for chain mapping pub fn build_chain_arm(struct_name: &Ident, previous_type: &TypePath) -> proc_macro2::TokenStream { + let enum_variant = &previous_type.path.segments.last().unwrap().ident; quote! { - #struct_name => #previous_type, + #struct_name => #enum_variant, } } /// Builds a match arm for chain existence check pub fn build_chain_exist_arm(previous_type: &TypePath) -> proc_macro2::TokenStream { + let enum_variant = &previous_type.path.segments.last().unwrap().ident; quote! { - Self::#previous_type => true, + Self::#enum_variant => true, } } -- cgit