From 2ffa3dc1d9efb6da99cc2f5c7b93c063887bec40 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Tue, 31 Oct 2017 20:24:41 +0000 Subject: [PATCH] optionally implement minidom::IntoElements --- src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 30ba7f7..f0280d9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -363,7 +363,7 @@ impl Jid { extern crate minidom; #[cfg(feature = "minidom")] -use minidom::IntoAttributeValue; +use minidom::{IntoAttributeValue, IntoElements, ElementEmitter}; #[cfg(feature = "minidom")] 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)] mod tests { use super::*;