From 4dc585f1c984e7af4027b5666f8f439430f4c46b Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sat, 29 Apr 2017 03:50:02 +0100 Subject: [PATCH] delay: Implement IntoElements. --- src/delay.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/delay.rs b/src/delay.rs index 54fa7e87..6d0634a2 100644 --- a/src/delay.rs +++ b/src/delay.rs @@ -1,4 +1,5 @@ -use minidom::Element; +use minidom::{Element, IntoElements}; +use minidom::convert::ElementEmitter; use error::Error; @@ -40,6 +41,13 @@ pub fn serialise(delay: &Delay) -> Element { .build() } +impl IntoElements for Delay { + fn into_elements(self, emitter: &mut ElementEmitter) { + let elem = serialise(&self); + emitter.append_child(elem) + } +} + #[cfg(test)] mod tests { use minidom::Element;