From 4b3be4dbb9191d5e563ca525442516872683dce9 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 31 Dec 2023 14:59:03 -0800 Subject: [PATCH] Inline strip_attrs_pub into ast_enum macro --- src/macros.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index cf04326096..9ff72a3b8e 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -37,14 +37,13 @@ macro_rules! ast_struct { macro_rules! ast_enum { ( - [$($attrs_pub:tt)*] - enum $name:ident $($rest:tt)* + $(#[$enum_attr:meta])* + $pub:ident $enum:ident $name:ident $body:tt ) => { - $($attrs_pub)* enum $name $($rest)* - }; + check_keyword_matches!(pub $pub); + check_keyword_matches!(enum $enum); - ($($t:tt)*) => { - strip_attrs_pub!(ast_enum!($($t)*)); + $(#[$enum_attr])* $pub $enum $name $body }; }