diff --git a/Cargo.toml b/Cargo.toml index 57783567112121287eb378667f1216ce37bfdd1c..e87ebc91d8e10a5b153fddc56ef26cd2a4d4baea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jid" -version = "0.3.0" +version = "0.3.1" authors = ["lumi ", "Emmanuel Gil Peyrot "] description = "A crate which provides a Jid struct for Jabber IDs." homepage = "https://gitlab.com/lumi/jid-rs" diff --git a/src/lib.rs b/src/lib.rs index 30ba7f7a03ce71dce5861600c2849e53e008be9b..f0280d99aab1fa1670c06031411e0795686118ef 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::*;