Switch ping to edition 2018 (#780)

This commit is contained in:
Pierre Krieger 2018-12-13 15:34:35 +01:00 committed by GitHub
parent 0803e36d5a
commit 7b8e3dd613
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 20 deletions

View File

@ -1,5 +1,6 @@
[package]
name = "libp2p-ping"
edition = "2018"
description = "Ping protocol for libp2p"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]

View File

@ -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},

View File

@ -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;

View File

@ -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};

View File

@ -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};