optionally implement minidom::IntoElements

This commit is contained in:
Emmanuel Gil Peyrot 2017-10-31 20:24:41 +00:00
parent e0124e50f6
commit 2ffa3dc1d9

View file

@ -363,7 +363,7 @@ impl Jid {
extern crate minidom; extern crate minidom;
#[cfg(feature = "minidom")] #[cfg(feature = "minidom")]
use minidom::IntoAttributeValue; use minidom::{IntoAttributeValue, IntoElements, ElementEmitter};
#[cfg(feature = "minidom")] #[cfg(feature = "minidom")]
impl IntoAttributeValue for Jid { impl IntoAttributeValue for Jid {
@ -372,6 +372,13 @@ impl IntoAttributeValue for Jid {
} }
} }
#[cfg(feature = "minidom")]
impl IntoElements for Jid {
fn into_elements(self, emitter: &mut ElementEmitter) {
emitter.append_text_node(String::from(self))
}
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use super::*; use super::*;