macros: Remove use requirement on std::str::FromStr.

Emmanuel Gil Peyrot created

Change summary

src/data_forms.rs   | 1 -
src/ibb.rs          | 2 --
src/jingle_ft.rs    | 2 +-
src/jingle_ibb.rs   | 2 --
src/jingle_s5b.rs   | 2 +-
src/macros.rs       | 8 ++++----
src/mam.rs          | 2 +-
src/message.rs      | 2 +-
src/muc/user.rs     | 1 -
src/pubsub/event.rs | 1 -
src/roster.rs       | 3 +--
src/sasl.rs         | 2 --
src/stanza_error.rs | 1 -
13 files changed, 9 insertions(+), 20 deletions(-)

Detailed changes

src/data_forms.rs 🔗

@@ -5,7 +5,6 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 use try_from::TryFrom;
-use std::str::FromStr;
 
 use minidom::{Element, IntoAttributeValue};
 

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 std::str::FromStr;
-
 use minidom::{Element, IntoAttributeValue};
 
 use error::Error;

src/jingle_ft.rs 🔗

@@ -5,9 +5,9 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 use try_from::TryFrom;
+use std::str::FromStr;
 
 use std::collections::BTreeMap;
-use std::str::FromStr;
 
 use hashes::Hash;
 use jingle::{Creator, ContentId};

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 std::str::FromStr;
-
 use minidom::{Element, IntoAttributeValue};
 
 use error::Error;

src/jingle_s5b.rs 🔗

@@ -5,7 +5,6 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 use try_from::TryFrom;
-use std::str::FromStr;
 use std::net::IpAddr;
 
 use minidom::{Element, IntoAttributeValue};
@@ -206,6 +205,7 @@ impl From<Transport> for Element {
 #[cfg(test)]
 mod tests {
     use super::*;
+    use std::str::FromStr;
     use compare_elements::NamespaceAwareCompare;
 
     #[test]

src/macros.rs 🔗

@@ -51,7 +51,7 @@ macro_rules! generate_attribute {
                 $a
             ),+
         }
-        impl FromStr for $elem {
+        impl ::std::str::FromStr for $elem {
             type Err = Error;
             fn from_str(s: &str) -> Result<$elem, Error> {
                 Ok(match s {
@@ -77,7 +77,7 @@ macro_rules! generate_attribute {
                 $a
             ),+
         }
-        impl FromStr for $elem {
+        impl ::std::str::FromStr for $elem {
             type Err = Error;
             fn from_str(s: &str) -> Result<$elem, Error> {
                 Ok(match s {
@@ -298,7 +298,7 @@ macro_rules! generate_id {
     ($elem:ident) => (
         #[derive(Debug, Clone, PartialEq, Eq, Hash)]
         pub struct $elem(pub String);
-        impl FromStr for $elem {
+        impl ::std::str::FromStr for $elem {
             type Err = Error;
             fn from_str(s: &str) -> Result<$elem, Error> {
                 // TODO: add a way to parse that differently when needed.
@@ -317,7 +317,7 @@ macro_rules! generate_elem_id {
     ($elem:ident, $name:tt, $ns:expr) => (
         #[derive(Debug, Clone, PartialEq, Eq, Hash)]
         pub struct $elem(pub String);
-        impl FromStr for $elem {
+        impl ::std::str::FromStr for $elem {
             type Err = Error;
             fn from_str(s: &str) -> Result<$elem, Error> {
                 // TODO: add a way to parse that differently when needed.

src/mam.rs 🔗

@@ -5,7 +5,6 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 use try_from::TryFrom;
-use std::str::FromStr;
 
 use minidom::{Element, IntoAttributeValue};
 use jid::Jid;
@@ -220,6 +219,7 @@ impl From<Prefs> for Element {
 #[cfg(test)]
 mod tests {
     use super::*;
+    use std::str::FromStr;
 
     #[test]
     fn test_query() {

src/message.rs 🔗

@@ -5,7 +5,6 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 use try_from::TryFrom;
-use std::str::FromStr;
 use std::collections::BTreeMap;
 
 use minidom::{Element, IntoAttributeValue};
@@ -278,6 +277,7 @@ impl From<Message> for Element {
 #[cfg(test)]
 mod tests {
     use super::*;
+    use std::str::FromStr;
     use compare_elements::NamespaceAwareCompare;
 
     #[test]

src/muc/user.rs 🔗

@@ -6,7 +6,6 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 use try_from::{TryFrom, TryInto};
-use std::str::FromStr;
 
 use minidom::{Element, IntoAttributeValue};
 

src/pubsub/event.rs 🔗

@@ -5,7 +5,6 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 use try_from::TryFrom;
-use std::str::FromStr;
 
 use minidom::{Element, IntoAttributeValue};
 use jid::Jid;

src/roster.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 std::str::FromStr;
-
 use minidom::{Element, IntoAttributeValue};
 use jid::Jid;
 
@@ -64,6 +62,7 @@ generate_element_with_children!(
 mod tests {
     use super::*;
     use try_from::TryFrom;
+    use std::str::FromStr;
     use compare_elements::NamespaceAwareCompare;
 
     #[test]

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 std::str::FromStr;
-
 use minidom::{Element, IntoAttributeValue};
 
 use error::Error;

src/stanza_error.rs 🔗

@@ -5,7 +5,6 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 use try_from::TryFrom;
-use std::str::FromStr;
 use std::collections::BTreeMap;
 
 use minidom::{Element, IntoAttributeValue};