From cb6eb55686c07200c2bac2a2c98b87a5fda075d8 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Thu, 23 Nov 2017 16:06:35 +0000 Subject: [PATCH] macros: Uniformise trailing commas handling. --- src/macros.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/macros.rs b/src/macros.rs index 136b32f..2d02a03 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -179,8 +179,8 @@ macro_rules! generate_element_with_only_attributes { pub struct $elem { $( $(#[$attr_meta])* - pub $attr: $attr_type - ),* + pub $attr: $attr_type, + )* } impl TryFrom for $elem { @@ -192,8 +192,8 @@ macro_rules! generate_element_with_only_attributes { check_no_unknown_attributes!(elem, $name, [$($attr_name),*]); Ok($elem { $( - $attr: get_attr!(elem, $attr_name, $attr_action) - ),* + $attr: get_attr!(elem, $attr_name, $attr_action), + )* }) } } @@ -259,8 +259,8 @@ macro_rules! generate_element_with_text { pub struct $elem { $( $(#[$attr_meta])* - pub $attr: $attr_type - ),*, + pub $attr: $attr_type, + )* pub $text_ident: $text_type, } @@ -273,8 +273,8 @@ macro_rules! generate_element_with_text { check_no_unknown_attributes!(elem, $name, [$($attr_name),*]); Ok($elem { $( - $attr: get_attr!(elem, $attr_name, $attr_action) - ),*, + $attr: get_attr!(elem, $attr_name, $attr_action), + )* $text_ident: $codec::decode(&elem.text())?, }) } @@ -301,12 +301,12 @@ macro_rules! generate_element_with_children { pub struct $elem { $( $(#[$attr_meta])* - pub $attr: $attr_type - ),*, + pub $attr: $attr_type, + )* $( $(#[$child_meta])* - pub $child_ident: Vec<$child_type> - ),* + pub $child_ident: Vec<$child_type>, + )* } impl TryFrom for $elem { @@ -324,10 +324,10 @@ macro_rules! generate_element_with_children { } Ok($elem { $( - $attr: get_attr!(elem, $attr_name, $attr_action) - ),*, + $attr: get_attr!(elem, $attr_name, $attr_action), + )* $( - $child_ident: parsed_children + $child_ident: parsed_children, )* }) }