macros: Remove use requirement on std::str::FromStr.
This commit is contained in:
parent
292cdd059c
commit
040792c242
13 changed files with 9 additions and 20 deletions
|
|
@ -5,7 +5,6 @@
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use try_from::TryFrom;
|
use try_from::TryFrom;
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use minidom::{Element, IntoAttributeValue};
|
use minidom::{Element, IntoAttributeValue};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// 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/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use minidom::{Element, IntoAttributeValue};
|
use minidom::{Element, IntoAttributeValue};
|
||||||
|
|
||||||
use error::Error;
|
use error::Error;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use try_from::TryFrom;
|
use try_from::TryFrom;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use hashes::Hash;
|
use hashes::Hash;
|
||||||
use jingle::{Creator, ContentId};
|
use jingle::{Creator, ContentId};
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// 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/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use minidom::{Element, IntoAttributeValue};
|
use minidom::{Element, IntoAttributeValue};
|
||||||
|
|
||||||
use error::Error;
|
use error::Error;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use try_from::TryFrom;
|
use try_from::TryFrom;
|
||||||
use std::str::FromStr;
|
|
||||||
use std::net::IpAddr;
|
use std::net::IpAddr;
|
||||||
|
|
||||||
use minidom::{Element, IntoAttributeValue};
|
use minidom::{Element, IntoAttributeValue};
|
||||||
|
|
@ -206,6 +205,7 @@ impl From<Transport> for Element {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use std::str::FromStr;
|
||||||
use compare_elements::NamespaceAwareCompare;
|
use compare_elements::NamespaceAwareCompare;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ macro_rules! generate_attribute {
|
||||||
$a
|
$a
|
||||||
),+
|
),+
|
||||||
}
|
}
|
||||||
impl FromStr for $elem {
|
impl ::std::str::FromStr for $elem {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
fn from_str(s: &str) -> Result<$elem, Error> {
|
fn from_str(s: &str) -> Result<$elem, Error> {
|
||||||
Ok(match s {
|
Ok(match s {
|
||||||
|
|
@ -77,7 +77,7 @@ macro_rules! generate_attribute {
|
||||||
$a
|
$a
|
||||||
),+
|
),+
|
||||||
}
|
}
|
||||||
impl FromStr for $elem {
|
impl ::std::str::FromStr for $elem {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
fn from_str(s: &str) -> Result<$elem, Error> {
|
fn from_str(s: &str) -> Result<$elem, Error> {
|
||||||
Ok(match s {
|
Ok(match s {
|
||||||
|
|
@ -298,7 +298,7 @@ macro_rules! generate_id {
|
||||||
($elem:ident) => (
|
($elem:ident) => (
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
pub struct $elem(pub String);
|
pub struct $elem(pub String);
|
||||||
impl FromStr for $elem {
|
impl ::std::str::FromStr for $elem {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
fn from_str(s: &str) -> Result<$elem, Error> {
|
fn from_str(s: &str) -> Result<$elem, Error> {
|
||||||
// TODO: add a way to parse that differently when needed.
|
// 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) => (
|
($elem:ident, $name:tt, $ns:expr) => (
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
pub struct $elem(pub String);
|
pub struct $elem(pub String);
|
||||||
impl FromStr for $elem {
|
impl ::std::str::FromStr for $elem {
|
||||||
type Err = Error;
|
type Err = Error;
|
||||||
fn from_str(s: &str) -> Result<$elem, Error> {
|
fn from_str(s: &str) -> Result<$elem, Error> {
|
||||||
// TODO: add a way to parse that differently when needed.
|
// TODO: add a way to parse that differently when needed.
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use try_from::TryFrom;
|
use try_from::TryFrom;
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use minidom::{Element, IntoAttributeValue};
|
use minidom::{Element, IntoAttributeValue};
|
||||||
use jid::Jid;
|
use jid::Jid;
|
||||||
|
|
@ -220,6 +219,7 @@ impl From<Prefs> for Element {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_query() {
|
fn test_query() {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use try_from::TryFrom;
|
use try_from::TryFrom;
|
||||||
use std::str::FromStr;
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
use minidom::{Element, IntoAttributeValue};
|
use minidom::{Element, IntoAttributeValue};
|
||||||
|
|
@ -278,6 +277,7 @@ impl From<Message> for Element {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use std::str::FromStr;
|
||||||
use compare_elements::NamespaceAwareCompare;
|
use compare_elements::NamespaceAwareCompare;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use try_from::{TryFrom, TryInto};
|
use try_from::{TryFrom, TryInto};
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use minidom::{Element, IntoAttributeValue};
|
use minidom::{Element, IntoAttributeValue};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use try_from::TryFrom;
|
use try_from::TryFrom;
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use minidom::{Element, IntoAttributeValue};
|
use minidom::{Element, IntoAttributeValue};
|
||||||
use jid::Jid;
|
use jid::Jid;
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// 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/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use minidom::{Element, IntoAttributeValue};
|
use minidom::{Element, IntoAttributeValue};
|
||||||
use jid::Jid;
|
use jid::Jid;
|
||||||
|
|
||||||
|
|
@ -64,6 +62,7 @@ generate_element_with_children!(
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use try_from::TryFrom;
|
use try_from::TryFrom;
|
||||||
|
use std::str::FromStr;
|
||||||
use compare_elements::NamespaceAwareCompare;
|
use compare_elements::NamespaceAwareCompare;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
// 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/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use std::str::FromStr;
|
|
||||||
|
|
||||||
use minidom::{Element, IntoAttributeValue};
|
use minidom::{Element, IntoAttributeValue};
|
||||||
|
|
||||||
use error::Error;
|
use error::Error;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
use try_from::TryFrom;
|
use try_from::TryFrom;
|
||||||
use std::str::FromStr;
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
use minidom::{Element, IntoAttributeValue};
|
use minidom::{Element, IntoAttributeValue};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue