From 2aa7bda3cb21ce6c052b82e08bcab79a625d04f2 Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Sun, 31 May 2026 02:42:52 +0800 Subject: Enhance code quality across the entire codebase --- mingling_macros/src/entry.rs | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'mingling_macros/src/entry.rs') diff --git a/mingling_macros/src/entry.rs b/mingling_macros/src/entry.rs index 6237e41..2ac5d6b 100644 --- a/mingling_macros/src/entry.rs +++ b/mingling_macros/src/entry.rs @@ -42,21 +42,16 @@ fn parse_strings(input: &syn::parse::ParseBuffer) -> syn::Result> { pub fn entry(input: TokenStream) -> TokenStream { let parsed = parse_macro_input!(input as EntryInput); - let string_exprs = match &parsed { - EntryInput::Typed { .. } | EntryInput::Untyped { .. } => { - let strings = match &parsed { - EntryInput::Typed { strings, .. } => strings, - EntryInput::Untyped { strings } => strings, - }; - strings - .iter() - .map(|s| { - let lit = syn::LitStr::new(s, proc_macro2::Span::call_site()); - quote! { #lit.to_string() } - }) - .collect::>() - } + let strings = match &parsed { + EntryInput::Typed { strings, .. } | EntryInput::Untyped { strings } => strings, }; + let string_exprs = strings + .iter() + .map(|s| { + let lit = syn::LitStr::new(s, proc_macro2::Span::call_site()); + quote! { #lit.to_string() } + }) + .collect::>(); let expanded = match parsed { EntryInput::Typed { ident, .. } => { -- cgit