Remove Negotiated from upgrade traits (#1388)

* Remove Negotiated from upgrade traits

* Remove import
This commit is contained in:
Pierre Krieger
2020-01-13 14:34:43 +01:00
committed by GitHub
parent ff780b5bff
commit 42a45e2630
31 changed files with 218 additions and 220 deletions

View File

@ -19,7 +19,6 @@
// DEALINGS IN THE SOFTWARE.
use crate::{
Negotiated,
either::{EitherOutput, EitherError, EitherFuture2, EitherName},
upgrade::{InboundUpgrade, OutboundUpgrade, UpgradeInfo}
};
@ -56,7 +55,7 @@ where
type Error = EitherError<EA, EB>;
type Future = EitherFuture2<A::Future, B::Future>;
fn upgrade_inbound(self, sock: Negotiated<C>, info: Self::Info) -> Self::Future {
fn upgrade_inbound(self, sock: C, info: Self::Info) -> Self::Future {
match (self, info) {
(EitherUpgrade::A(a), EitherName::A(info)) => EitherFuture2::A(a.upgrade_inbound(sock, info)),
(EitherUpgrade::B(b), EitherName::B(info)) => EitherFuture2::B(b.upgrade_inbound(sock, info)),
@ -74,7 +73,7 @@ where
type Error = EitherError<EA, EB>;
type Future = EitherFuture2<A::Future, B::Future>;
fn upgrade_outbound(self, sock: Negotiated<C>, info: Self::Info) -> Self::Future {
fn upgrade_outbound(self, sock: C, info: Self::Info) -> Self::Future {
match (self, info) {
(EitherUpgrade::A(a), EitherName::A(info)) => EitherFuture2::A(a.upgrade_outbound(sock, info)),
(EitherUpgrade::B(b), EitherName::B(info)) => EitherFuture2::B(b.upgrade_outbound(sock, info)),