How to allow optional trailing commas in macros?
Make the comma optional As DK. points out, the trailing comma can be made optional. Rust 1.32 You can use the ? macro repeater to write this and disallow multiple trailing commas: ($Name:ident { $($Variant:ident),* $(,)? }) => { // ^^^^^ Previous versions This allows multiple trailing commas: ($Name:ident { $($Variant:ident),* $(,)* }) => { … Read more