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/res_injection.rs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'mingling_macros/src/res_injection.rs') diff --git a/mingling_macros/src/res_injection.rs b/mingling_macros/src/res_injection.rs index f2280e3..4f0be88 100644 --- a/mingling_macros/src/res_injection.rs +++ b/mingling_macros/src/res_injection.rs @@ -30,21 +30,7 @@ pub(crate) fn extract_args_info( FnArg::Typed(PatType { pat, ty, .. }) => { let param_pat = (**pat).clone(); match &**ty { - Type::Path(type_path) => { - // Check that the type is a single-segment type (no `::`) - if type_path.path.segments.len() > 1 { - return Err(syn::Error::new( - type_path.span(), - format!( - "The type `{}` must be a simple single-segment type, \ - e.g. `Empty` instead of `other::Empty`. \ - Qualified paths with `::` are not allowed here.", - quote! { #type_path } - ), - )); - } - (param_pat, type_path.clone()) - } + Type::Path(type_path) => (param_pat, type_path.clone()), Type::Reference(_) => { return Err(syn::Error::new( ty.span(), -- cgit