From fc41f3e2db0db8e672fc09f786f9b0bf02029b52 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Mon, 29 Jun 2026 13:42:01 +0800 Subject: refactor: simplify match arm syntax in grouped derive pattern --- mingling_pathf/src/patterns/groupped_derive.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'mingling_pathf') diff --git a/mingling_pathf/src/patterns/groupped_derive.rs b/mingling_pathf/src/patterns/groupped_derive.rs index 9f7301d..44e7731 100644 --- a/mingling_pathf/src/patterns/groupped_derive.rs +++ b/mingling_pathf/src/patterns/groupped_derive.rs @@ -24,30 +24,27 @@ impl AnalyzePattern for GrouppedDerivePattern { for item in &syntax.items { match item { - Item::Struct(s) => { - if has_groupped_derive(&s.attrs) { + Item::Struct(s) + if has_groupped_derive(&s.attrs) => { items.push(AnalyzeItem { module: String::new(), item_name: s.ident.to_string(), }); } - } - Item::Enum(e) => { - if has_groupped_derive(&e.attrs) { + Item::Enum(e) + if has_groupped_derive(&e.attrs) => { items.push(AnalyzeItem { module: String::new(), item_name: e.ident.to_string(), }); } - } - Item::Union(u) => { - if has_groupped_derive(&u.attrs) { + Item::Union(u) + if has_groupped_derive(&u.attrs) => { items.push(AnalyzeItem { module: String::new(), item_name: u.ident.to_string(), }); } - } Item::Mod(item_mod) => { if let Some((_, nested)) = &item_mod.content { for n in nested { -- cgit