mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-29 10:41:21 +00:00
Move final crates to 2018 edition (#886)
This commit is contained in:
parent
073df709dd
commit
fe4fc8c363
@ -518,7 +518,6 @@ where TBehaviour: NetworkBehaviour,
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::nodes::raw_swarm::RawSwarm;
|
||||
use crate::peer_id::PeerId;
|
||||
use crate::protocols_handler::{DummyProtocolsHandler, ProtocolsHandler};
|
||||
use crate::public_key::PublicKey;
|
||||
@ -526,10 +525,9 @@ mod tests {
|
||||
use futures::prelude::*;
|
||||
use multiaddr::Multiaddr;
|
||||
use rand::random;
|
||||
use smallvec::SmallVec;
|
||||
use std::marker::PhantomData;
|
||||
use super::{ConnectedPoint, NetworkBehaviour, NetworkBehaviourAction,
|
||||
PollParameters, Swarm, SwarmBuilder};
|
||||
PollParameters, SwarmBuilder};
|
||||
use tokio_io::{AsyncRead, AsyncWrite};
|
||||
use void::Void;
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
[package]
|
||||
name = "libp2p-core-derive"
|
||||
edition = "2018"
|
||||
description = "Procedural macros of libp2p-core"
|
||||
version = "0.2.2"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
@ -1,5 +1,6 @@
|
||||
[package]
|
||||
name = "parity-multiaddr"
|
||||
edition = "2018"
|
||||
authors = ["dignifiedquire <dignifiedquire@gmail.com>", "Parity Technologies <admin@parity.io>"]
|
||||
description = "Implementation of the multiaddr format"
|
||||
homepage = "https://github.com/libp2p/rust-libp2p"
|
||||
|
@ -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),
|
||||
|
@ -1,5 +1,6 @@
|
||||
[package]
|
||||
name = "parity-multihash"
|
||||
edition = "2018"
|
||||
description = "Implementation of the multihash format"
|
||||
repository = "https://github.com/libp2p/rust-libp2p"
|
||||
keywords = ["multihash", "ipfs"]
|
||||
|
@ -21,8 +21,8 @@ use sha2::Digest;
|
||||
use tiny_keccak::Keccak;
|
||||
use unsigned_varint::{decode, encode};
|
||||
|
||||
pub use errors::{DecodeError, DecodeOwnedError, EncodeError};
|
||||
pub use hashes::Hash;
|
||||
pub use self::errors::{DecodeError, DecodeOwnedError, EncodeError};
|
||||
pub use self::hashes::Hash;
|
||||
|
||||
// Helper macro for encoding input into output using sha1, sha2, tiny_keccak, or blake2
|
||||
macro_rules! encode {
|
||||
@ -276,7 +276,7 @@ pub fn to_hex(bytes: &[u8]) -> String {
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use {Hash, Multihash};
|
||||
use crate::{Hash, Multihash};
|
||||
|
||||
#[test]
|
||||
fn rand_generates_valid_multihash() {
|
||||
|
@ -1,5 +1,6 @@
|
||||
[package]
|
||||
name = "peer-id-generator"
|
||||
edition = "2018"
|
||||
version = "0.1.0"
|
||||
description = "Generate peer ids that are prefixed with a specific string"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
@ -1,5 +1,6 @@
|
||||
[package]
|
||||
name = "rw-stream-sink"
|
||||
edition = "2018"
|
||||
description = "Adaptator between Stream/Sink and AsyncRead/AsyncWrite"
|
||||
version = "0.1.0"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user