diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-22 20:21:41 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-22 20:21:41 +0800 |
| commit | d7c9ad94113cca2f782666e37a0aa4fb7b8d7d86 (patch) | |
| tree | 323dfc74a274463500ac52c7bb7b83029b771411 /mingling_macros/src/res_injection.rs | |
| parent | 232f31c6649e6348a5b0b64362f185f7f4db1dc0 (diff) | |
Support qualified type paths in four macros
Diffstat (limited to 'mingling_macros/src/res_injection.rs')
| -rw-r--r-- | mingling_macros/src/res_injection.rs | 16 |
1 files changed, 1 insertions, 15 deletions
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(), |
