diff --git a/src/attention.rs b/src/attention.rs index 9a7ed98c..d7521e9c 100644 --- a/src/attention.rs +++ b/src/attention.rs @@ -4,8 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; - use error::Error; use ns; @@ -16,6 +14,7 @@ generate_empty_element!(Attention, "attention", ns::ATTENTION); mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; #[test] fn test_simple() { diff --git a/src/chatstates.rs b/src/chatstates.rs index 83ac6f55..33ce0a9c 100644 --- a/src/chatstates.rs +++ b/src/chatstates.rs @@ -6,8 +6,6 @@ #![deny(missing_docs)] -use minidom::Element; - use error::Error; use ns; @@ -37,6 +35,7 @@ generate_element_enum!( mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; #[test] fn test_simple() { diff --git a/src/component.rs b/src/component.rs index a93fc40b..778b9618 100644 --- a/src/component.rs +++ b/src/component.rs @@ -4,7 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; use error::Error; use helpers::PlainText; use ns; @@ -37,6 +36,7 @@ impl Handshake { mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; #[test] fn test_simple() { diff --git a/src/delay.rs b/src/delay.rs index 8aba744e..5591c113 100644 --- a/src/delay.rs +++ b/src/delay.rs @@ -4,7 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; use date::DateTime; use error::Error; @@ -25,6 +24,7 @@ generate_element_with_text!(Delay, "delay", ns::DELAY, mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; use std::str::FromStr; #[test] diff --git a/src/eme.rs b/src/eme.rs index 9016123f..b023a5ab 100644 --- a/src/eme.rs +++ b/src/eme.rs @@ -4,8 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; - use error::Error; use ns; @@ -25,6 +23,7 @@ ExplicitMessageEncryption, "encryption", ns::EME, [ mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; #[test] fn test_simple() { diff --git a/src/hashes.rs b/src/hashes.rs index 47843cea..472d4c47 100644 --- a/src/hashes.rs +++ b/src/hashes.rs @@ -6,7 +6,7 @@ use std::str::FromStr; -use minidom::{Element, IntoAttributeValue}; +use minidom::IntoAttributeValue; use error::Error; @@ -93,6 +93,7 @@ impl Hash { mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; #[test] fn test_simple() { diff --git a/src/ibb.rs b/src/ibb.rs index 3471715b..555dfb2e 100644 --- a/src/ibb.rs +++ b/src/ibb.rs @@ -4,8 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; - use error::Error; use ns; @@ -38,6 +36,7 @@ generate_element_with_only_attributes!(Close, "close", ns::IBB, [ mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; use std::error::Error as StdError; #[test] diff --git a/src/idle.rs b/src/idle.rs index f2831ea1..ea82ee31 100644 --- a/src/idle.rs +++ b/src/idle.rs @@ -4,7 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; use date::DateTime; use error::Error; @@ -19,6 +18,7 @@ generate_element_with_only_attributes!(Idle, "idle", ns::IDLE, [ mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; use std::str::FromStr; use std::error::Error as StdError; diff --git a/src/jingle_ibb.rs b/src/jingle_ibb.rs index 2f6d0b15..5cc0f256 100644 --- a/src/jingle_ibb.rs +++ b/src/jingle_ibb.rs @@ -4,8 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; - use error::Error; use ns; @@ -24,6 +22,7 @@ generate_element_with_only_attributes!(Transport, "transport", ns::JINGLE_IBB, [ mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; use std::error::Error as StdError; #[test] diff --git a/src/macros.rs b/src/macros.rs index 45b5c056..752e5bb8 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -116,9 +116,9 @@ macro_rules! generate_element_enum { $enum ),+ } - impl ::try_from::TryFrom for $elem { + impl ::try_from::TryFrom<::minidom::Element> for $elem { type Err = Error; - fn try_from(elem: Element) -> Result<$elem, Error> { + fn try_from(elem: ::minidom::Element) -> Result<$elem, Error> { check_ns_only!(elem, $name, $ns); check_no_children!(elem, $name); check_no_attributes!(elem, $name); @@ -128,9 +128,9 @@ macro_rules! generate_element_enum { }) } } - impl From<$elem> for Element { - fn from(elem: $elem) -> Element { - Element::builder(match elem { + impl From<$elem> for ::minidom::Element { + fn from(elem: $elem) -> ::minidom::Element { + ::minidom::Element::builder(match elem { $($elem::$enum => $enum_name,)+ }).ns($ns) .build() @@ -152,9 +152,9 @@ macro_rules! generate_attribute_enum { $enum ),+ } - impl ::try_from::TryFrom for $elem { + impl ::try_from::TryFrom<::minidom::Element> for $elem { type Err = Error; - fn try_from(elem: Element) -> Result<$elem, Error> { + fn try_from(elem: ::minidom::Element) -> Result<$elem, Error> { check_ns_only!(elem, $name, $ns); check_no_children!(elem, $name); check_no_unknown_attributes!(elem, $name, [$attr]); @@ -164,9 +164,9 @@ macro_rules! generate_attribute_enum { }) } } - impl From<$elem> for Element { - fn from(elem: $elem) -> Element { - Element::builder($name) + impl From<$elem> for ::minidom::Element { + fn from(elem: $elem) -> ::minidom::Element { + ::minidom::Element::builder($name) .ns($ns) .attr($attr, match elem { $($elem::$enum => $enum_name,)+ @@ -231,10 +231,10 @@ macro_rules! generate_empty_element { #[derive(Debug, Clone)] pub struct $elem; - impl ::try_from::TryFrom for $elem { + impl ::try_from::TryFrom<::minidom::Element> for $elem { type Err = Error; - fn try_from(elem: Element) -> Result<$elem, Error> { + fn try_from(elem: ::minidom::Element) -> Result<$elem, Error> { check_self!(elem, $name, $ns); check_no_children!(elem, $name); check_no_attributes!(elem, $name); @@ -242,9 +242,9 @@ macro_rules! generate_empty_element { } } - impl From<$elem> for Element { - fn from(_: $elem) -> Element { - Element::builder($name) + impl From<$elem> for ::minidom::Element { + fn from(_: $elem) -> ::minidom::Element { + ::minidom::Element::builder($name) .ns($ns) .build() } @@ -266,10 +266,10 @@ macro_rules! generate_element_with_only_attributes { )* } - impl ::try_from::TryFrom for $elem { + impl ::try_from::TryFrom<::minidom::Element> for $elem { type Err = Error; - fn try_from(elem: Element) -> Result<$elem, Error> { + fn try_from(elem: ::minidom::Element) -> Result<$elem, Error> { check_self!(elem, $name, $ns); check_no_children!(elem, $name); check_no_unknown_attributes!(elem, $name, [$($attr_name),*]); @@ -281,9 +281,9 @@ macro_rules! generate_element_with_only_attributes { } } - impl From<$elem> for Element { - fn from(elem: $elem) -> Element { - Element::builder($name) + impl From<$elem> for ::minidom::Element { + fn from(elem: $elem) -> ::minidom::Element { + ::minidom::Element::builder($name) .ns($ns) $( .attr($attr_name, elem.$attr) @@ -324,9 +324,9 @@ macro_rules! generate_elem_id { Ok($elem(String::from(s))) } } - impl ::try_from::TryFrom for $elem { + impl ::try_from::TryFrom<::minidom::Element> for $elem { type Err = Error; - fn try_from(elem: Element) -> Result<$elem, Error> { + fn try_from(elem: ::minidom::Element) -> Result<$elem, Error> { check_self!(elem, $name, $ns); check_no_children!(elem, $name); check_no_attributes!(elem, $name); @@ -334,9 +334,9 @@ macro_rules! generate_elem_id { Ok($elem(elem.text())) } } - impl From<$elem> for Element { - fn from(elem: $elem) -> Element { - Element::builder($name) + impl From<$elem> for ::minidom::Element { + fn from(elem: $elem) -> ::minidom::Element { + ::minidom::Element::builder($name) .ns($ns) .append(elem.0) .build() @@ -360,10 +360,10 @@ macro_rules! generate_element_with_text { pub $text_ident: $text_type, } - impl ::try_from::TryFrom for $elem { + impl ::try_from::TryFrom<::minidom::Element> for $elem { type Err = Error; - fn try_from(elem: Element) -> Result<$elem, Error> { + fn try_from(elem: ::minidom::Element) -> Result<$elem, Error> { check_self!(elem, $name, $ns); check_no_children!(elem, $name); check_no_unknown_attributes!(elem, $name, [$($attr_name),*]); @@ -376,9 +376,9 @@ macro_rules! generate_element_with_text { } } - impl From<$elem> for Element { - fn from(elem: $elem) -> Element { - Element::builder($name) + impl From<$elem> for ::minidom::Element { + fn from(elem: $elem) -> ::minidom::Element { + ::minidom::Element::builder($name) .ns($ns) $( .attr($attr_name, elem.$attr) @@ -405,10 +405,10 @@ macro_rules! generate_element_with_children { )* } - impl ::try_from::TryFrom for $elem { + impl ::try_from::TryFrom<::minidom::Element> for $elem { type Err = Error; - fn try_from(elem: Element) -> Result<$elem, Error> { + fn try_from(elem: ::minidom::Element) -> Result<$elem, Error> { check_self!(elem, $name, $ns); check_no_unknown_attributes!(elem, $name, [$($attr_name),*]); let mut parsed_children = vec!(); @@ -433,9 +433,9 @@ macro_rules! generate_element_with_children { } } - impl From<$elem> for Element { - fn from(elem: $elem) -> Element { - Element::builder($name) + impl From<$elem> for ::minidom::Element { + fn from(elem: $elem) -> ::minidom::Element { + ::minidom::Element::builder($name) .ns($ns) $( .attr($attr_name, elem.$attr) diff --git a/src/media_element.rs b/src/media_element.rs index b3e1aa57..a3d159a3 100644 --- a/src/media_element.rs +++ b/src/media_element.rs @@ -4,8 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; - use error::Error; use ns; @@ -32,6 +30,7 @@ generate_element_with_children!(MediaElement, "media", ns::MEDIA_ELEMENT, mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; use data_forms::DataForm; use std::error::Error as StdError; diff --git a/src/message_correct.rs b/src/message_correct.rs index bfd33b86..259eb88a 100644 --- a/src/message_correct.rs +++ b/src/message_correct.rs @@ -4,8 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; - use error::Error; use ns; @@ -18,6 +16,7 @@ generate_element_with_only_attributes!(Replace, "replace", ns::MESSAGE_CORRECT, mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; #[test] fn test_simple() { diff --git a/src/mood.rs b/src/mood.rs index 80f3147a..5ec89f60 100644 --- a/src/mood.rs +++ b/src/mood.rs @@ -6,8 +6,6 @@ #![deny(missing_docs)] -use minidom::Element; - use error::Error; use ns; @@ -273,6 +271,7 @@ generate_element_enum!( mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; #[test] fn test_simple() { diff --git a/src/ping.rs b/src/ping.rs index 615580df..cacf3c35 100644 --- a/src/ping.rs +++ b/src/ping.rs @@ -5,8 +5,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; - use error::Error; use ns; @@ -17,6 +15,7 @@ generate_empty_element!(Ping, "ping", ns::PING); mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; #[test] fn test_simple() { diff --git a/src/receipts.rs b/src/receipts.rs index e9ec8326..0c785c1c 100644 --- a/src/receipts.rs +++ b/src/receipts.rs @@ -4,8 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; - use error::Error; use ns; @@ -20,6 +18,7 @@ generate_element_with_only_attributes!(Received, "received", ns::RECEIPTS, [ mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; #[test] fn test_simple() { diff --git a/src/roster.rs b/src/roster.rs index 96d39586..556cf113 100644 --- a/src/roster.rs +++ b/src/roster.rs @@ -4,7 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; use jid::Jid; use error::Error; @@ -62,6 +61,7 @@ generate_element_with_children!( mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; use std::str::FromStr; use compare_elements::NamespaceAwareCompare; diff --git a/src/sasl.rs b/src/sasl.rs index e7a22632..23a56c43 100644 --- a/src/sasl.rs +++ b/src/sasl.rs @@ -4,8 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; - use error::Error; use ns; @@ -40,6 +38,7 @@ generate_element_with_text!(Success, "success", ns::SASL, mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; #[test] fn test_simple() { diff --git a/src/stanza_id.rs b/src/stanza_id.rs index 3fbcfae8..a02d8bf4 100644 --- a/src/stanza_id.rs +++ b/src/stanza_id.rs @@ -4,7 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; use jid::Jid; use error::Error; @@ -24,6 +23,7 @@ generate_element_with_only_attributes!(OriginId, "origin-id", ns::SID, [ mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; use std::str::FromStr; #[test] diff --git a/src/stream.rs b/src/stream.rs index 168eee1f..ee934116 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -4,7 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; use jid::Jid; use error::Error; use ns; @@ -55,6 +54,7 @@ impl Stream { mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; #[test] fn test_simple() { diff --git a/src/websocket.rs b/src/websocket.rs index e98d278d..4257278e 100644 --- a/src/websocket.rs +++ b/src/websocket.rs @@ -4,7 +4,6 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. -use minidom::Element; use jid::Jid; use error::Error; use ns; @@ -55,6 +54,7 @@ impl Open { mod tests { use super::*; use try_from::TryFrom; + use minidom::Element; #[test] fn test_simple() {