mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-12 01:21:21 +00:00
Move final crates to 2018 edition (#886)
This commit is contained in:
committed by
Pierre Krieger
parent
073df709dd
commit
fe4fc8c363
@ -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)]
|
||||
|
@ -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),
|
||||
|
Reference in New Issue
Block a user