1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-27 15:29:03 +02:00

add request chain services

This commit is contained in:
Nikolay Kim
2019-03-02 11:53:05 -08:00
parent fdf3011837
commit cc20fee628
6 changed files with 360 additions and 150 deletions

View File

@ -117,7 +117,6 @@ where
enum EncoderBody<B> {
Body(B),
Other(Box<dyn MessageBody>),
None,
}
pub struct Encoder<B> {
@ -131,7 +130,6 @@ impl<B: MessageBody> MessageBody for Encoder<B> {
match self.body {
EncoderBody::Body(ref b) => b.length(),
EncoderBody::Other(ref b) => b.length(),
EncoderBody::None => BodyLength::Empty,
}
} else {
BodyLength::Stream
@ -143,7 +141,6 @@ impl<B: MessageBody> MessageBody for Encoder<B> {
let result = match self.body {
EncoderBody::Body(ref mut b) => b.poll_next()?,
EncoderBody::Other(ref mut b) => b.poll_next()?,
EncoderBody::None => return Ok(Async::Ready(None)),
};
match result {
Async::NotReady => return Ok(Async::NotReady),