diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-06-29 13:42:01 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-06-29 13:42:01 +0800 |
| commit | fc41f3e2db0db8e672fc09f786f9b0bf02029b52 (patch) | |
| tree | 7207b3fafa5814c3e8356cc8dae98257b30583b0 /mingling_pathf/src/patterns | |
| parent | 18b734d36bf07fb797556e264c91e1d7c64f9051 (diff) | |
refactor: simplify match arm syntax in grouped derive pattern
Diffstat (limited to 'mingling_pathf/src/patterns')
| -rw-r--r-- | mingling_pathf/src/patterns/groupped_derive.rs | 15 |
1 files changed, 6 insertions, 9 deletions
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 { |
