diff --git a/src/attention.rs b/src/attention.rs index 9a7ed98c618124fd9e0688d0a6187cae15b5cb24..d7521e9c758b8533b068c3647491f82b09a6c903 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 83ac6f55b5b6973270429381e65802b24f7e2937..33ce0a9c04f9206fafd058c19bfd5b9894d68378 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 a93fc40ba9bfdbbca5453aa86ef4ea0c39020f33..778b9618ef15b6d7280dfb7ca231a0bf740440ca 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 8aba744ee5ce46b11a9c41e7919f63724cb06813..5591c113dc45beed397ac90b7536e2fcada40e2d 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 9016123f8a5aee0e1e8a4d8fdfa57eb765dd2120..b023a5abfbd165ac8536baf87aa0dfee5158dbbd 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 47843cea1ef89fba99c482780704a536aa02f007..472d4c471063e90fc8c2635613ea2b41e3490084 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 3471715b9bcebe39bbb2052fdb21e19ba0184176..555dfb2ee714527328d105f4288847e4e164ae94 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 f2831ea1813c18909016c244a5c6504b91fef201..ea82ee31061a81df7e14c42373841501b5e46974 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 2f6d0b1575a17bcb9238f86d79ae3dc557665161..5cc0f25623d52853e1b079c859ffb530d3ec57dc 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 45b5c056df97a25f16452485d318e01f1333976d..752e5bb85db623ea47c4b53901a8e2fefe2f6ab0 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 b3e1aa5716c06dabc1c22cd7e8b00ad522de2014..a3d159a382c997daa954b70c4a05076f8cbbabc1 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 bfd33b86bd877c31948a789ebcf36c760a0882f0..259eb88a3643ed3c50a0cfbb6198da78662c9434 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 80f3147a18c18c7e7a840295ac85532e7d8f97d0..5ec89f600a5d306c665d9196e54a4290eb45b416 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 615580dfd548e98fe5b3505ac8428874e995b348..cacf3c355694ab90dfc14a80d2e90b687130ac2d 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 e9ec83265692f389285b5d8eaf6998e7c0da4d56..0c785c1cb63ec9a3838ad639b73749f031d08949 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 96d39586af794304e1cc212dd2a8a4060e186cca..556cf11384aee058ba3b9f542175d83d3d6c208f 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 e7a226327db7958becfa79ec771a529382269b06..23a56c43bdb64d96cc9f81fab0f4092593294d8b 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 3fbcfae857e19be0bf17d99f078f7e595762125a..a02d8bf45c442de6f2d1a8f4a3992d25e82b9ca3 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 168eee1fc25f5d34cd112d8caa9544f6487ef7dc..ee934116a58bdbaff7920677b95cccdb127c2bf5 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 e98d278dcaf978fd8fb825f9e90e88fe17fbe851..4257278eb8f0eccece30258e64d555e4e38182e6 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() {