mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-18 20:41:25 +00:00
Fix mapping of upgrade. (#654)
The current implementation of `MapUpgrade` implements `InboundUpgrade` and `OutboundUpgrade` and applies the transformation in both cases which means that mapping is always applied to inbound and outbound upgrades. This commit uses separate `MapInboundUpgrade` and `MapOutboundUpgrade` types which implements both traits but only map in one direction.
This commit is contained in:
@ -771,7 +771,7 @@ where
|
||||
upgrade::OrUpgrade<
|
||||
upgrade::Toggleable<
|
||||
upgrade::MapUpgradeErr<
|
||||
upgrade::MapUpgrade<
|
||||
upgrade::MapInboundUpgrade<
|
||||
TProto1::InboundProtocol,
|
||||
fn(TProto1Out) -> EitherOutput<TProto1Out, TProto2Out>
|
||||
>,
|
||||
@ -784,7 +784,7 @@ where
|
||||
>,
|
||||
upgrade::Toggleable<
|
||||
upgrade::MapUpgradeErr<
|
||||
upgrade::MapUpgrade<
|
||||
upgrade::MapInboundUpgrade<
|
||||
TProto2::InboundProtocol,
|
||||
fn(TProto2Out) -> EitherOutput<TProto1Out, TProto2Out>
|
||||
>,
|
||||
@ -801,7 +801,7 @@ where
|
||||
upgrade::OrUpgrade<
|
||||
upgrade::Toggleable<
|
||||
upgrade::MapUpgradeErr<
|
||||
upgrade::MapUpgrade<
|
||||
upgrade::MapOutboundUpgrade<
|
||||
TProto1::OutboundProtocol,
|
||||
fn(TProto1Out) -> EitherOutput<TProto1Out, TProto2Out>
|
||||
>,
|
||||
@ -814,7 +814,7 @@ where
|
||||
>,
|
||||
upgrade::Toggleable<
|
||||
upgrade::MapUpgradeErr<
|
||||
upgrade::MapUpgrade<
|
||||
upgrade::MapOutboundUpgrade<
|
||||
TProto2::OutboundProtocol,
|
||||
fn(TProto2Out) -> EitherOutput<TProto1Out, TProto2Out>
|
||||
>,
|
||||
|
Reference in New Issue
Block a user