mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
macros: Uniformise trailing commas handling.
This commit is contained in:
parent
3f57edfc27
commit
cb6eb55686
1 changed files with 15 additions and 15 deletions
|
@ -179,8 +179,8 @@ macro_rules! generate_element_with_only_attributes {
|
||||||
pub struct $elem {
|
pub struct $elem {
|
||||||
$(
|
$(
|
||||||
$(#[$attr_meta])*
|
$(#[$attr_meta])*
|
||||||
pub $attr: $attr_type
|
pub $attr: $attr_type,
|
||||||
),*
|
)*
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<Element> for $elem {
|
impl TryFrom<Element> for $elem {
|
||||||
|
@ -192,8 +192,8 @@ macro_rules! generate_element_with_only_attributes {
|
||||||
check_no_unknown_attributes!(elem, $name, [$($attr_name),*]);
|
check_no_unknown_attributes!(elem, $name, [$($attr_name),*]);
|
||||||
Ok($elem {
|
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 {
|
pub struct $elem {
|
||||||
$(
|
$(
|
||||||
$(#[$attr_meta])*
|
$(#[$attr_meta])*
|
||||||
pub $attr: $attr_type
|
pub $attr: $attr_type,
|
||||||
),*,
|
)*
|
||||||
pub $text_ident: $text_type,
|
pub $text_ident: $text_type,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,8 +273,8 @@ macro_rules! generate_element_with_text {
|
||||||
check_no_unknown_attributes!(elem, $name, [$($attr_name),*]);
|
check_no_unknown_attributes!(elem, $name, [$($attr_name),*]);
|
||||||
Ok($elem {
|
Ok($elem {
|
||||||
$(
|
$(
|
||||||
$attr: get_attr!(elem, $attr_name, $attr_action)
|
$attr: get_attr!(elem, $attr_name, $attr_action),
|
||||||
),*,
|
)*
|
||||||
$text_ident: $codec::decode(&elem.text())?,
|
$text_ident: $codec::decode(&elem.text())?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -301,12 +301,12 @@ macro_rules! generate_element_with_children {
|
||||||
pub struct $elem {
|
pub struct $elem {
|
||||||
$(
|
$(
|
||||||
$(#[$attr_meta])*
|
$(#[$attr_meta])*
|
||||||
pub $attr: $attr_type
|
pub $attr: $attr_type,
|
||||||
),*,
|
)*
|
||||||
$(
|
$(
|
||||||
$(#[$child_meta])*
|
$(#[$child_meta])*
|
||||||
pub $child_ident: Vec<$child_type>
|
pub $child_ident: Vec<$child_type>,
|
||||||
),*
|
)*
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<Element> for $elem {
|
impl TryFrom<Element> for $elem {
|
||||||
|
@ -324,10 +324,10 @@ macro_rules! generate_element_with_children {
|
||||||
}
|
}
|
||||||
Ok($elem {
|
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,
|
||||||
)*
|
)*
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue