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)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::nodes::raw_swarm::RawSwarm;
|
|
||||||
use crate::peer_id::PeerId;
|
use crate::peer_id::PeerId;
|
||||||
use crate::protocols_handler::{DummyProtocolsHandler, ProtocolsHandler};
|
use crate::protocols_handler::{DummyProtocolsHandler, ProtocolsHandler};
|
||||||
use crate::public_key::PublicKey;
|
use crate::public_key::PublicKey;
|
||||||
@ -526,10 +525,9 @@ mod tests {
|
|||||||
use futures::prelude::*;
|
use futures::prelude::*;
|
||||||
use multiaddr::Multiaddr;
|
use multiaddr::Multiaddr;
|
||||||
use rand::random;
|
use rand::random;
|
||||||
use smallvec::SmallVec;
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use super::{ConnectedPoint, NetworkBehaviour, NetworkBehaviourAction,
|
use super::{ConnectedPoint, NetworkBehaviour, NetworkBehaviourAction,
|
||||||
PollParameters, Swarm, SwarmBuilder};
|
PollParameters, SwarmBuilder};
|
||||||
use tokio_io::{AsyncRead, AsyncWrite};
|
use tokio_io::{AsyncRead, AsyncWrite};
|
||||||
use void::Void;
|
use void::Void;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "libp2p-core-derive"
|
name = "libp2p-core-derive"
|
||||||
|
edition = "2018"
|
||||||
description = "Procedural macros of libp2p-core"
|
description = "Procedural macros of libp2p-core"
|
||||||
version = "0.2.2"
|
version = "0.2.2"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "parity-multiaddr"
|
name = "parity-multiaddr"
|
||||||
|
edition = "2018"
|
||||||
authors = ["dignifiedquire <dignifiedquire@gmail.com>", "Parity Technologies <admin@parity.io>"]
|
authors = ["dignifiedquire <dignifiedquire@gmail.com>", "Parity Technologies <admin@parity.io>"]
|
||||||
description = "Implementation of the multiaddr format"
|
description = "Implementation of the multiaddr format"
|
||||||
homepage = "https://github.com/libp2p/rust-libp2p"
|
homepage = "https://github.com/libp2p/rust-libp2p"
|
||||||
|
@ -30,8 +30,8 @@ use std::{
|
|||||||
result::Result as StdResult,
|
result::Result as StdResult,
|
||||||
str::FromStr
|
str::FromStr
|
||||||
};
|
};
|
||||||
pub use errors::{Result, Error};
|
pub use self::errors::{Result, Error};
|
||||||
pub use protocol::Protocol;
|
pub use self::protocol::Protocol;
|
||||||
|
|
||||||
/// Representation of a Multiaddr.
|
/// Representation of a Multiaddr.
|
||||||
#[derive(PartialEq, Eq, Clone, Hash)]
|
#[derive(PartialEq, Eq, Clone, Hash)]
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
use bs58;
|
use bs58;
|
||||||
use byteorder::{BigEndian, ByteOrder, ReadBytesExt, WriteBytesExt};
|
use byteorder::{BigEndian, ByteOrder, ReadBytesExt, WriteBytesExt};
|
||||||
|
use crate::{Result, Error};
|
||||||
use data_encoding::BASE32;
|
use data_encoding::BASE32;
|
||||||
use multihash::Multihash;
|
use multihash::Multihash;
|
||||||
use std::{
|
use std::{
|
||||||
@ -11,7 +12,6 @@ use std::{
|
|||||||
str::{self, FromStr}
|
str::{self, FromStr}
|
||||||
};
|
};
|
||||||
use unsigned_varint::{encode, decode};
|
use unsigned_varint::{encode, decode};
|
||||||
use {Result, Error};
|
|
||||||
|
|
||||||
const DCCP: u32 = 33;
|
const DCCP: u32 = 33;
|
||||||
const DNS4: u32 = 54;
|
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.
|
/// Turn this `Protocol` into one that owns its data, thus being valid for any lifetime.
|
||||||
pub fn acquire<'b>(self) -> Protocol<'b> {
|
pub fn acquire<'b>(self) -> Protocol<'b> {
|
||||||
use Protocol::*;
|
use self::Protocol::*;
|
||||||
match self {
|
match self {
|
||||||
Dccp(a) => Dccp(a),
|
Dccp(a) => Dccp(a),
|
||||||
Dns4(cow) => Dns4(Cow::Owned(cow.into_owned())),
|
Dns4(cow) => Dns4(Cow::Owned(cow.into_owned())),
|
||||||
@ -351,7 +351,7 @@ impl<'a> Protocol<'a> {
|
|||||||
|
|
||||||
impl<'a> fmt::Display for Protocol<'a> {
|
impl<'a> fmt::Display for Protocol<'a> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
use Protocol::*;
|
use self::Protocol::*;
|
||||||
match self {
|
match self {
|
||||||
Dccp(port) => write!(f, "/dccp/{}", port),
|
Dccp(port) => write!(f, "/dccp/{}", port),
|
||||||
Dns4(s) => write!(f, "/dns4/{}", s),
|
Dns4(s) => write!(f, "/dns4/{}", s),
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "parity-multihash"
|
name = "parity-multihash"
|
||||||
|
edition = "2018"
|
||||||
description = "Implementation of the multihash format"
|
description = "Implementation of the multihash format"
|
||||||
repository = "https://github.com/libp2p/rust-libp2p"
|
repository = "https://github.com/libp2p/rust-libp2p"
|
||||||
keywords = ["multihash", "ipfs"]
|
keywords = ["multihash", "ipfs"]
|
||||||
|
@ -21,8 +21,8 @@ use sha2::Digest;
|
|||||||
use tiny_keccak::Keccak;
|
use tiny_keccak::Keccak;
|
||||||
use unsigned_varint::{decode, encode};
|
use unsigned_varint::{decode, encode};
|
||||||
|
|
||||||
pub use errors::{DecodeError, DecodeOwnedError, EncodeError};
|
pub use self::errors::{DecodeError, DecodeOwnedError, EncodeError};
|
||||||
pub use hashes::Hash;
|
pub use self::hashes::Hash;
|
||||||
|
|
||||||
// Helper macro for encoding input into output using sha1, sha2, tiny_keccak, or blake2
|
// Helper macro for encoding input into output using sha1, sha2, tiny_keccak, or blake2
|
||||||
macro_rules! encode {
|
macro_rules! encode {
|
||||||
@ -276,7 +276,7 @@ pub fn to_hex(bytes: &[u8]) -> String {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use {Hash, Multihash};
|
use crate::{Hash, Multihash};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn rand_generates_valid_multihash() {
|
fn rand_generates_valid_multihash() {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "peer-id-generator"
|
name = "peer-id-generator"
|
||||||
|
edition = "2018"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "Generate peer ids that are prefixed with a specific string"
|
description = "Generate peer ids that are prefixed with a specific string"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "rw-stream-sink"
|
name = "rw-stream-sink"
|
||||||
|
edition = "2018"
|
||||||
description = "Adaptator between Stream/Sink and AsyncRead/AsyncWrite"
|
description = "Adaptator between Stream/Sink and AsyncRead/AsyncWrite"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user