Add ToXml impl for slices
This commit is contained in:
parent
4ad194fc1f
commit
fbe513ab5a
|
@ -518,6 +518,16 @@ impl<'xml, T: FromXml<'xml>> FromXml<'xml> for Vec<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: ToXml> ToXml 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>(
|
fn serialize<W: fmt::Write + ?Sized>(
|
||||||
&self,
|
&self,
|
||||||
field: Option<Id<'_>>,
|
field: Option<Id<'_>>,
|
||||||
|
|
Loading…
Reference in New Issue