From 689b7cf8363f6b0ac2d67d2c3620b16afb8aa510 Mon Sep 17 00:00:00 2001 From: Paul Fariello Date: Wed, 27 Nov 2019 18:17:10 +0100 Subject: [PATCH] Fix serialisation of Optional field --- xmpp-parsers/src/util/macros.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/xmpp-parsers/src/util/macros.rs b/xmpp-parsers/src/util/macros.rs index 1072fb19..52f33053 100644 --- a/xmpp-parsers/src/util/macros.rs +++ b/xmpp-parsers/src/util/macros.rs @@ -590,18 +590,18 @@ macro_rules! generate_serialiser { })) }; ($builder:ident, $parent:ident, $elem:ident, Option, $constructor:ident, ($name:tt, *)) => { - $builder.append_all($parent.$elem.map(|elem| { - crate::Element::builder($name) - .ns(elem.get_ns()) - .append(::minidom::Node::Element(crate::Element::from(elem))) - })) + $builder.append_all( + $parent + .$elem + .map(|elem| ::minidom::Node::Element(crate::Element::from(elem))), + ) }; ($builder:ident, $parent:ident, $elem:ident, Option, $constructor:ident, ($name:tt, $ns:ident)) => { - $builder.append_all($parent.$elem.map(|elem| { - crate::Element::builder($name) - .ns(crate::ns::$ns) - .append(::minidom::Node::Element(crate::Element::from(elem))) - })) + $builder.append_all( + $parent + .$elem + .map(|elem| ::minidom::Node::Element(crate::Element::from(elem))), + ) }; ($builder:ident, $parent:ident, $elem:ident, Vec, $constructor:ident, ($name:tt, $ns:ident)) => { $builder.append_all($parent.$elem.into_iter())