mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-13 01:51:23 +00:00
Remove Negotiated from upgrade traits (#1388)
* Remove Negotiated from upgrade traits * Remove import
This commit is contained in:
@ -31,7 +31,6 @@ use libp2p_core::{
|
||||
InboundUpgrade,
|
||||
OutboundUpgrade,
|
||||
UpgradeInfo,
|
||||
upgrade::Negotiated,
|
||||
PeerId,
|
||||
PublicKey,
|
||||
};
|
||||
@ -84,21 +83,21 @@ impl UpgradeInfo for PlainText1Config {
|
||||
}
|
||||
|
||||
impl<C> InboundUpgrade<C> for PlainText1Config {
|
||||
type Output = Negotiated<C>;
|
||||
type Output = C;
|
||||
type Error = Void;
|
||||
type Future = Ready<Result<Negotiated<C>, Self::Error>>;
|
||||
type Future = Ready<Result<C, Self::Error>>;
|
||||
|
||||
fn upgrade_inbound(self, i: Negotiated<C>, _: Self::Info) -> Self::Future {
|
||||
fn upgrade_inbound(self, i: C, _: Self::Info) -> Self::Future {
|
||||
future::ready(Ok(i))
|
||||
}
|
||||
}
|
||||
|
||||
impl<C> OutboundUpgrade<C> for PlainText1Config {
|
||||
type Output = Negotiated<C>;
|
||||
type Output = C;
|
||||
type Error = Void;
|
||||
type Future = Ready<Result<Negotiated<C>, Self::Error>>;
|
||||
type Future = Ready<Result<C, Self::Error>>;
|
||||
|
||||
fn upgrade_outbound(self, i: Negotiated<C>, _: Self::Info) -> Self::Future {
|
||||
fn upgrade_outbound(self, i: C, _: Self::Info) -> Self::Future {
|
||||
future::ready(Ok(i))
|
||||
}
|
||||
}
|
||||
@ -123,11 +122,11 @@ impl<C> InboundUpgrade<C> for PlainText2Config
|
||||
where
|
||||
C: AsyncRead + AsyncWrite + Send + Unpin + 'static
|
||||
{
|
||||
type Output = (PeerId, PlainTextOutput<Negotiated<C>>);
|
||||
type Output = (PeerId, PlainTextOutput<C>);
|
||||
type Error = PlainTextError;
|
||||
type Future = BoxFuture<'static, Result<Self::Output, Self::Error>>;
|
||||
|
||||
fn upgrade_inbound(self, socket: Negotiated<C>, _: Self::Info) -> Self::Future {
|
||||
fn upgrade_inbound(self, socket: C, _: Self::Info) -> Self::Future {
|
||||
Box::pin(self.handshake(socket))
|
||||
}
|
||||
}
|
||||
@ -136,11 +135,11 @@ impl<C> OutboundUpgrade<C> for PlainText2Config
|
||||
where
|
||||
C: AsyncRead + AsyncWrite + Send + Unpin + 'static
|
||||
{
|
||||
type Output = (PeerId, PlainTextOutput<Negotiated<C>>);
|
||||
type Output = (PeerId, PlainTextOutput<C>);
|
||||
type Error = PlainTextError;
|
||||
type Future = BoxFuture<'static, Result<Self::Output, Self::Error>>;
|
||||
|
||||
fn upgrade_outbound(self, socket: Negotiated<C>, _: Self::Info) -> Self::Future {
|
||||
fn upgrade_outbound(self, socket: C, _: Self::Info) -> Self::Future {
|
||||
Box::pin(self.handshake(socket))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user