diff options
Diffstat (limited to 'mingling_macros/src/groupped.rs')
| -rw-r--r-- | mingling_macros/src/groupped.rs | 14 |
1 files changed, 6 insertions, 8 deletions
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<Ident> { for attr in attrs { - if attr.path().is_ident("group") { - if let Ok(meta) = attr.parse_args::<syn::Meta>() { - 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::<syn::Meta>() + && let syn::Meta::Path(path) = meta + && let Some(segment) = path.segments.last() + { + return Some(segment.ident.clone()); } } None |
