Add blanket ToXml implementation for &impl ToXml
This commit is contained in:
parent
d06d289103
commit
23abf75725
|
@ -22,6 +22,17 @@ pub trait ToXml {
|
|||
const KIND: Kind;
|
||||
}
|
||||
|
||||
impl<'a, T: ToXml + ?Sized> ToXml for &'a T {
|
||||
fn serialize<W: fmt::Write + ?Sized>(
|
||||
&self,
|
||||
serializer: &mut Serializer<W>,
|
||||
) -> Result<(), Error> {
|
||||
(*self).serialize(serializer)
|
||||
}
|
||||
|
||||
const KIND: Kind = T::KIND;
|
||||
}
|
||||
|
||||
pub trait FromXml<'xml>: Sized {
|
||||
fn deserialize<'cx>(deserializer: &'cx mut Deserializer<'cx, 'xml>) -> Result<Self, Error>;
|
||||
|
||||
|
|
Loading…
Reference in New Issue