From 2fe5dbd9a3e71da6cf8d3ef500a54411e23a8514 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 6 Apr 2026 16:01:00 +0800 Subject: Add check_all script and simplify attribute parsing --- mingling_macros/src/groupped.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'mingling_macros/src') diff --git a/mingling_macros/src/groupped.rs b/mingling_macros/src/groupped.rs index 187ea46..2f9934f 100644 --- a/mingling_macros/src/groupped.rs +++ b/mingling_macros/src/groupped.rs @@ -11,14 +11,12 @@ use syn::{Attribute, DeriveInput, Ident, parse_macro_input}; /// Parses the `#[group(...)]` attribute to extract the group type fn parse_group_attribute(attrs: &[Attribute]) -> Option { for attr in attrs { - if attr.path().is_ident("group") { - if let Ok(meta) = attr.parse_args::() { - if let syn::Meta::Path(path) = meta { - if let Some(segment) = path.segments.last() { - return Some(segment.ident.clone()); - } - } - } + if attr.path().is_ident("group") + && let Ok(meta) = attr.parse_args::() + && let syn::Meta::Path(path) = meta + && let Some(segment) = path.segments.last() + { + return Some(segment.ident.clone()); } } None -- cgit