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

This commit is contained in:
Emmanuel Gil Peyrot 2018-05-14 16:11:22 +02:00
commit 040792c242
13 changed files with 9 additions and 20 deletions

View file

@ -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};

View file

@ -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;

View file

@ -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};

View file

@ -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;

View file

@ -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]

View file

@ -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.

View file

@ -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() {

View file

@ -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]

View file

@ -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};

View file

@ -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;

View file

@ -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]

View file

@ -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;

View file

@ -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};