From 205079adce08d566c28fa139abebf9ac069c247b Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Mon, 24 Sep 2018 20:51:53 -0700 Subject: [PATCH] simplify framed transport error --- src/framed.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/framed.rs b/src/framed.rs index 10ea0c36..a1053271 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -159,10 +159,10 @@ where } /// Framed transport errors -pub enum FramedTransportError { - Decoder(::Error), - Encoder(::Error), - Service(S::Error), +pub enum FramedTransportError { + Service(E1), + Encoder(E2), + Decoder(E3), } /// FramedTransport - is a future that reads frames from Framed object @@ -185,8 +185,8 @@ where enum TransportState { Processing, - Error(FramedTransportError), - EncoderError(FramedTransportError), + Error(FramedTransportError::Error, ::Error>), + EncoderError(FramedTransportError::Error, ::Error>), Stopping, } @@ -355,7 +355,7 @@ where ::Error: 'static, { type Item = (); - type Error = FramedTransportError; + type Error = FramedTransportError::Error, ::Error>; fn poll(&mut self) -> Poll { match mem::replace(&mut self.state, TransportState::Processing) {