1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-07-01 12:15:08 +02:00

simplify client decoder

This commit is contained in:
Nikolay Kim
2018-11-14 10:52:40 -08:00
parent 6297fe0d41
commit 03ad9a3105
6 changed files with 46 additions and 90 deletions

View File

@ -172,10 +172,7 @@ where
{
fut: Box<
Future<
Item = (
Option<h1::Message<ClientResponse>>,
Framed<T, h1::ClientCodec>,
),
Item = (Option<ClientResponse>, Framed<T, h1::ClientCodec>),
Error = ClientError,
>,
>,
@ -196,8 +193,7 @@ where
let (item, framed) = try_ready!(self.fut.poll());
let res = match item {
Some(h1::Message::Item(res)) => res,
Some(h1::Message::Chunk(_)) => unreachable!(),
Some(res) => res,
None => return Err(ClientError::Disconnected),
};