Эх сурвалжийг харах

Allow trailing commas in enum_with_unknown macro

Closes: #75
Approved by: whitequark
Philipp Oppermann 7 жил өмнө
parent
commit
5900178d61
1 өөрчлөгдсөн 2 нэмэгдсэн , 2 устгасан
  1. 2 2
      src/macros.rs

+ 2 - 2
src/macros.rs

@@ -27,7 +27,7 @@ macro_rules! enum_with_unknown {
     (
         $( #[$enum_attr:meta] )*
         pub enum $name:ident($ty:ty) {
-            $( $variant:ident = $value:expr ),+
+            $( $variant:ident = $value:expr ),+ $(,)*
         }
     ) => {
         enum_with_unknown! {
@@ -42,7 +42,7 @@ macro_rules! enum_with_unknown {
         pub doc enum $name:ident($ty:ty) {
             $(
               $( #[$variant_attr:meta] )+
-              $variant:ident = $value:expr
+              $variant:ident = $value:expr $(,)*
             ),+
         }
     ) => {