diff --git a/protocols/ping/Cargo.toml b/protocols/ping/Cargo.toml index 1e772d53..1795cf4d 100644 --- a/protocols/ping/Cargo.toml +++ b/protocols/ping/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "libp2p-ping" +edition = "2018" description = "Ping protocol for libp2p" version = "0.1.0" authors = ["Parity Technologies "] diff --git a/protocols/ping/src/dial_handler.rs b/protocols/ping/src/dial_handler.rs index 349c5106..fd6924be 100644 --- a/protocols/ping/src/dial_handler.rs +++ b/protocols/ping/src/dial_handler.rs @@ -18,6 +18,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +use crate::protocol::{Ping, PingDialer}; use futures::prelude::*; use libp2p_core::{ OutboundUpgrade, @@ -26,7 +27,6 @@ use libp2p_core::{ upgrade::DeniedUpgrade }; use log::warn; -use protocol::{Ping, PingDialer}; use std::{ io, mem, time::{Duration, Instant}, diff --git a/protocols/ping/src/lib.rs b/protocols/ping/src/lib.rs index a8a85ad5..b6fd975f 100644 --- a/protocols/ping/src/lib.rs +++ b/protocols/ping/src/lib.rs @@ -81,19 +81,6 @@ //! ``` //! -extern crate arrayvec; -extern crate bytes; -extern crate futures; -extern crate libp2p_core; -extern crate log; -extern crate multistream_select; -extern crate parking_lot; -extern crate rand; -extern crate tokio_codec; -extern crate tokio_io; -extern crate tokio_timer; -extern crate void; - pub use self::dial_layer::PeriodicPing; pub use self::listen_layer::PingListen; diff --git a/protocols/ping/src/listen_handler.rs b/protocols/ping/src/listen_handler.rs index 3c89dc4c..8eb115b7 100644 --- a/protocols/ping/src/listen_handler.rs +++ b/protocols/ping/src/listen_handler.rs @@ -18,6 +18,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +use crate::protocol::{Ping, PingListener}; use arrayvec::ArrayVec; use futures::prelude::*; use libp2p_core::{ @@ -27,7 +28,6 @@ use libp2p_core::{ upgrade::DeniedUpgrade }; use log::warn; -use protocol::{Ping, PingListener}; use std::io; use tokio_io::{AsyncRead, AsyncWrite}; use void::{Void, unreachable}; diff --git a/protocols/ping/src/protocol.rs b/protocols/ping/src/protocol.rs index 5eb44b3d..675b9022 100644 --- a/protocols/ping/src/protocol.rs +++ b/protocols/ping/src/protocol.rs @@ -320,11 +320,7 @@ impl Encoder for Codec { #[cfg(test)] mod tests { - extern crate tokio; - extern crate tokio_tcp; - - use self::tokio_tcp::TcpListener; - use self::tokio_tcp::TcpStream; + use tokio_tcp::{TcpListener, TcpStream}; use super::Ping; use futures::{Future, Stream}; use libp2p_core::upgrade::{InboundUpgrade, OutboundUpgrade};