mirror of
https://gitlab.com/xmpp-rs/xmpp-rs.git
synced 2024-07-12 22:21:53 +00:00
Fix serialisation of Optional field
This commit is contained in:
parent
3a2027411e
commit
689b7cf836
1 changed files with 10 additions and 10 deletions
|
@ -590,18 +590,18 @@ macro_rules! generate_serialiser {
|
||||||
}))
|
}))
|
||||||
};
|
};
|
||||||
($builder:ident, $parent:ident, $elem:ident, Option, $constructor:ident, ($name:tt, *)) => {
|
($builder:ident, $parent:ident, $elem:ident, Option, $constructor:ident, ($name:tt, *)) => {
|
||||||
$builder.append_all($parent.$elem.map(|elem| {
|
$builder.append_all(
|
||||||
crate::Element::builder($name)
|
$parent
|
||||||
.ns(elem.get_ns())
|
.$elem
|
||||||
.append(::minidom::Node::Element(crate::Element::from(elem)))
|
.map(|elem| ::minidom::Node::Element(crate::Element::from(elem))),
|
||||||
}))
|
)
|
||||||
};
|
};
|
||||||
($builder:ident, $parent:ident, $elem:ident, Option, $constructor:ident, ($name:tt, $ns:ident)) => {
|
($builder:ident, $parent:ident, $elem:ident, Option, $constructor:ident, ($name:tt, $ns:ident)) => {
|
||||||
$builder.append_all($parent.$elem.map(|elem| {
|
$builder.append_all(
|
||||||
crate::Element::builder($name)
|
$parent
|
||||||
.ns(crate::ns::$ns)
|
.$elem
|
||||||
.append(::minidom::Node::Element(crate::Element::from(elem)))
|
.map(|elem| ::minidom::Node::Element(crate::Element::from(elem))),
|
||||||
}))
|
)
|
||||||
};
|
};
|
||||||
($builder:ident, $parent:ident, $elem:ident, Vec, $constructor:ident, ($name:tt, $ns:ident)) => {
|
($builder:ident, $parent:ident, $elem:ident, Vec, $constructor:ident, ($name:tt, $ns:ident)) => {
|
||||||
$builder.append_all($parent.$elem.into_iter())
|
$builder.append_all($parent.$elem.into_iter())
|
||||||
|
|
Loading…
Reference in a new issue