Fix the Default implementation of Ping (#501)

This commit is contained in:
Pierre Krieger
2018-09-20 19:53:31 +02:00
committed by GitHub
parent 84b089cacc
commit 4d8da24c64

View File

@ -105,9 +105,16 @@ use tokio_io::{AsyncRead, AsyncWrite};
///
/// According to the design of libp2p, this struct would normally contain the configuration options
/// for the protocol, but in the case of `Ping` no configuration is required.
#[derive(Debug, Copy, Clone, Default)]
#[derive(Debug, Copy, Clone)]
pub struct Ping<TUserData = ()>(PhantomData<TUserData>);
impl<TUserData> Default for Ping<TUserData> {
#[inline]
fn default() -> Self {
Ping(PhantomData)
}
}
/// Output of a `Ping` upgrade.
pub enum PingOutput<TSocket, TUserData> {
/// We are on the dialing side.