refactor(core)!: remove EitherUpgrade (#3339)

We don't need to define our own type here, we can simply implement `UpgradeInfo`, `InboundUpgrade` and `OutboundUpgrade` on `either::Either`.
This commit is contained in:
Thomas Eizinger
2023-01-18 13:35:07 +11:00
committed by GitHub
parent 8cd14e6a3a
commit db2cd43826
14 changed files with 64 additions and 82 deletions

View File

@ -355,7 +355,7 @@ impl IntoConnectionHandler for Prototype {
}
fn inbound_protocol(&self) -> <Self::Handler as ConnectionHandler>::InboundProtocol {
upgrade::EitherUpgrade::A(SendWrapper(inbound_hop::Upgrade {
Either::Left(SendWrapper(inbound_hop::Upgrade {
reservation_duration: self.config.reservation_duration,
max_circuit_duration: self.config.max_circuit_duration,
max_circuit_bytes: self.config.max_circuit_bytes,

View File

@ -155,7 +155,7 @@ impl IntoConnectionHandler for Prototype {
}
fn inbound_protocol(&self) -> <Self::Handler as ConnectionHandler>::InboundProtocol {
upgrade::EitherUpgrade::A(SendWrapper(inbound_stop::Upgrade {}))
Either::Left(SendWrapper(inbound_stop::Upgrade {}))
}
}