Move final crates to 2018 edition (#886)

This commit is contained in:
Dan Robertson
2019-01-29 10:02:29 +00:00
committed by Pierre Krieger
parent 073df709dd
commit fe4fc8c363
9 changed files with 14 additions and 11 deletions

View File

@ -30,8 +30,8 @@ use std::{
result::Result as StdResult,
str::FromStr
};
pub use errors::{Result, Error};
pub use protocol::Protocol;
pub use self::errors::{Result, Error};
pub use self::protocol::Protocol;
/// Representation of a Multiaddr.
#[derive(PartialEq, Eq, Clone, Hash)]

View File

@ -1,5 +1,6 @@
use bs58;
use byteorder::{BigEndian, ByteOrder, ReadBytesExt, WriteBytesExt};
use crate::{Result, Error};
use data_encoding::BASE32;
use multihash::Multihash;
use std::{
@ -11,7 +12,6 @@ use std::{
str::{self, FromStr}
};
use unsigned_varint::{encode, decode};
use {Result, Error};
const DCCP: u32 = 33;
const DNS4: u32 = 54;
@ -320,7 +320,7 @@ impl<'a> Protocol<'a> {
/// Turn this `Protocol` into one that owns its data, thus being valid for any lifetime.
pub fn acquire<'b>(self) -> Protocol<'b> {
use Protocol::*;
use self::Protocol::*;
match self {
Dccp(a) => Dccp(a),
Dns4(cow) => Dns4(Cow::Owned(cow.into_owned())),
@ -351,7 +351,7 @@ impl<'a> Protocol<'a> {
impl<'a> fmt::Display for Protocol<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
use Protocol::*;
use self::Protocol::*;
match self {
Dccp(port) => write!(f, "/dccp/{}", port),
Dns4(s) => write!(f, "/dns4/{}", s),