Add ToXml impl for slices

This commit is contained in:
Dirkjan Ochtman 2022-12-01 17:56:47 +01:00
parent 4ad194fc1f
commit fbe513ab5a
1 changed files with 10 additions and 0 deletions

View File

@ -518,6 +518,16 @@ impl<'xml, T: FromXml<'xml>> FromXml<'xml> for Vec<T> {
}
impl<T: ToXml> ToXml for Vec<T> {
fn serialize<W: fmt::Write + ?Sized>(
&self,
field: Option<Id<'_>>,
serializer: &mut Serializer<W>,
) -> Result<(), Error> {
self.as_slice().serialize(field, serializer)
}
}
impl<T: ToXml> ToXml for [T] {
fn serialize<W: fmt::Write + ?Sized>(
&self,
field: Option<Id<'_>>,