From fbe513ab5a451b60cfef51095d8e08cfbfa064c8 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 1 Dec 2022 17:56:47 +0100 Subject: [PATCH] Add ToXml impl for slices --- instant-xml/src/impls.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/instant-xml/src/impls.rs b/instant-xml/src/impls.rs index 340bf57..f59679e 100644 --- a/instant-xml/src/impls.rs +++ b/instant-xml/src/impls.rs @@ -518,6 +518,16 @@ impl<'xml, T: FromXml<'xml>> FromXml<'xml> for Vec { } impl ToXml for Vec { + fn serialize( + &self, + field: Option>, + serializer: &mut Serializer, + ) -> Result<(), Error> { + self.as_slice().serialize(field, serializer) + } +} + +impl ToXml for [T] { fn serialize( &self, field: Option>,