macros: Remove use requirement on try_from::TryFrom.

Emmanuel Gil Peyrot created

Change summary

src/attention.rs       |  3 +--
src/chatstates.rs      |  3 +--
src/component.rs       |  3 +--
src/delay.rs           |  3 +--
src/eme.rs             |  3 +--
src/hashes.rs          |  2 +-
src/ibb.rs             |  2 +-
src/idle.rs            |  3 +--
src/jingle_ibb.rs      |  2 +-
src/macros.rs          | 14 +++++++-------
src/media_element.rs   |  3 +--
src/message_correct.rs |  3 +--
src/mood.rs            |  3 +--
src/ping.rs            |  3 +--
src/receipts.rs        |  3 +--
src/roster.rs          |  2 +-
src/sasl.rs            |  2 +-
src/stanza_id.rs       |  3 +--
src/stream.rs          |  3 +--
src/websocket.rs       |  3 +--
20 files changed, 26 insertions(+), 40 deletions(-)

Detailed changes

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 try_from::TryFrom;
-
 use minidom::Element;
 
 use error::Error;
@@ -17,6 +15,7 @@ generate_empty_element!(Attention, "attention", ns::ATTENTION);
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
 
     #[test]
     fn test_simple() {

src/chatstates.rs 🔗

@@ -6,8 +6,6 @@
 
 #![deny(missing_docs)]
 
-use try_from::TryFrom;
-
 use minidom::Element;
 
 use error::Error;
@@ -38,6 +36,7 @@ generate_element_enum!(
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
 
     #[test]
     fn test_simple() {

src/component.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 try_from::TryFrom;
-
 use minidom::Element;
 use error::Error;
 use helpers::PlainText;
@@ -38,6 +36,7 @@ impl Handshake {
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
 
     #[test]
     fn test_simple() {

src/delay.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 try_from::TryFrom;
-
 use minidom::Element;
 use date::DateTime;
 
@@ -26,6 +24,7 @@ generate_element_with_text!(Delay, "delay", ns::DELAY,
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
     use std::str::FromStr;
 
     #[test]

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 try_from::TryFrom;
-
 use minidom::Element;
 
 use error::Error;
@@ -26,6 +24,7 @@ ExplicitMessageEncryption, "encryption", ns::EME, [
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
 
     #[test]
     fn test_simple() {

src/hashes.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 try_from::TryFrom;
 use std::str::FromStr;
 
 use minidom::{Element, IntoAttributeValue};
@@ -93,6 +92,7 @@ impl Hash {
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
 
     #[test]
     fn test_simple() {

src/ibb.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 try_from::TryFrom;
 use std::str::FromStr;
 
 use minidom::{Element, IntoAttributeValue};
@@ -40,6 +39,7 @@ generate_element_with_only_attributes!(Close, "close", ns::IBB, [
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
     use std::error::Error as StdError;
 
     #[test]

src/idle.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 try_from::TryFrom;
-
 use minidom::Element;
 use date::DateTime;
 
@@ -20,6 +18,7 @@ generate_element_with_only_attributes!(Idle, "idle", ns::IDLE, [
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
     use std::str::FromStr;
     use std::error::Error as StdError;
 

src/jingle_ibb.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 try_from::TryFrom;
 use std::str::FromStr;
 
 use minidom::{Element, IntoAttributeValue};
@@ -26,6 +25,7 @@ generate_element_with_only_attributes!(Transport, "transport", ns::JINGLE_IBB, [
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
     use std::error::Error as StdError;
 
     #[test]

src/macros.rs 🔗

@@ -116,7 +116,7 @@ macro_rules! generate_element_enum {
             $enum
             ),+
         }
-        impl TryFrom<Element> for $elem {
+        impl ::try_from::TryFrom<Element> for $elem {
             type Err = Error;
             fn try_from(elem: Element) -> Result<$elem, Error> {
                 check_ns_only!(elem, $name, $ns);
@@ -152,7 +152,7 @@ macro_rules! generate_attribute_enum {
             $enum
             ),+
         }
-        impl TryFrom<Element> for $elem {
+        impl ::try_from::TryFrom<Element> for $elem {
             type Err = Error;
             fn try_from(elem: Element) -> Result<$elem, Error> {
                 check_ns_only!(elem, $name, $ns);
@@ -231,7 +231,7 @@ macro_rules! generate_empty_element {
         #[derive(Debug, Clone)]
         pub struct $elem;
 
-        impl TryFrom<Element> for $elem {
+        impl ::try_from::TryFrom<Element> for $elem {
             type Err = Error;
 
             fn try_from(elem: Element) -> Result<$elem, Error> {
@@ -266,7 +266,7 @@ macro_rules! generate_element_with_only_attributes {
             )*
         }
 
-        impl TryFrom<Element> for $elem {
+        impl ::try_from::TryFrom<Element> for $elem {
             type Err = Error;
 
             fn try_from(elem: Element) -> Result<$elem, Error> {
@@ -324,7 +324,7 @@ macro_rules! generate_elem_id {
                 Ok($elem(String::from(s)))
             }
         }
-        impl TryFrom<Element> for $elem {
+        impl ::try_from::TryFrom<Element> for $elem {
             type Err = Error;
             fn try_from(elem: Element) -> Result<$elem, Error> {
                 check_self!(elem, $name, $ns);
@@ -360,7 +360,7 @@ macro_rules! generate_element_with_text {
             pub $text_ident: $text_type,
         }
 
-        impl TryFrom<Element> for $elem {
+        impl ::try_from::TryFrom<Element> for $elem {
             type Err = Error;
 
             fn try_from(elem: Element) -> Result<$elem, Error> {
@@ -405,7 +405,7 @@ macro_rules! generate_element_with_children {
             )*
         }
 
-        impl TryFrom<Element> for $elem {
+        impl ::try_from::TryFrom<Element> for $elem {
             type Err = Error;
 
             fn try_from(elem: Element) -> Result<$elem, Error> {

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 try_from::TryFrom;
-
 use minidom::Element;
 
 use error::Error;
@@ -33,6 +31,7 @@ generate_element_with_children!(MediaElement, "media", ns::MEDIA_ELEMENT,
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
     use data_forms::DataForm;
     use std::error::Error as StdError;
 

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 try_from::TryFrom;
-
 use minidom::Element;
 
 use error::Error;
@@ -19,6 +17,7 @@ generate_element_with_only_attributes!(Replace, "replace", ns::MESSAGE_CORRECT,
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
 
     #[test]
     fn test_simple() {

src/mood.rs 🔗

@@ -6,8 +6,6 @@
 
 #![deny(missing_docs)]
 
-use try_from::TryFrom;
-
 use minidom::Element;
 
 use error::Error;
@@ -274,6 +272,7 @@ generate_element_enum!(
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
 
     #[test]
     fn test_simple() {

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 try_from::TryFrom;
-
 use minidom::Element;
 
 use error::Error;
@@ -18,6 +16,7 @@ generate_empty_element!(Ping, "ping", ns::PING);
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
 
     #[test]
     fn test_simple() {

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 try_from::TryFrom;
-
 use minidom::Element;
 
 use error::Error;
@@ -21,6 +19,7 @@ generate_element_with_only_attributes!(Received, "received", ns::RECEIPTS, [
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
 
     #[test]
     fn test_simple() {

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 try_from::TryFrom;
 use std::str::FromStr;
 
 use minidom::{Element, IntoAttributeValue};
@@ -64,6 +63,7 @@ generate_element_with_children!(
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
     use compare_elements::NamespaceAwareCompare;
 
     #[test]

src/sasl.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 try_from::TryFrom;
 use std::str::FromStr;
 
 use minidom::{Element, IntoAttributeValue};
@@ -42,6 +41,7 @@ generate_element_with_text!(Success, "success", ns::SASL,
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
 
     #[test]
     fn test_simple() {

src/stanza_id.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 try_from::TryFrom;
-
 use minidom::Element;
 use jid::Jid;
 
@@ -25,6 +23,7 @@ generate_element_with_only_attributes!(OriginId, "origin-id", ns::SID, [
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
     use std::str::FromStr;
 
     #[test]

src/stream.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 try_from::TryFrom;
-
 use minidom::Element;
 use jid::Jid;
 use error::Error;
@@ -56,6 +54,7 @@ impl Stream {
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
 
     #[test]
     fn test_simple() {

src/websocket.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 try_from::TryFrom;
-
 use minidom::Element;
 use jid::Jid;
 use error::Error;
@@ -56,6 +54,7 @@ impl Open {
 #[cfg(test)]
 mod tests {
     use super::*;
+    use try_from::TryFrom;
 
     #[test]
     fn test_simple() {