1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-23 01:51:11 +00:00

Fix EncoderBody enum to align with Body::Message

This commit is contained in:
Maksym Vorobiov 2020-02-10 15:19:56 +02:00 committed by Yuki Okushi
parent a84b37199a
commit e6078bf792

View file

@ -83,7 +83,7 @@ impl<B: MessageBody> Encoder<B> {
enum EncoderBody<B> {
Bytes(Bytes),
Stream(#[pin] B),
BoxedStream(#[pin] Box<dyn MessageBody>),
BoxedStream(Box<dyn MessageBody + Unpin>),
}
impl<B: MessageBody> MessageBody for EncoderBody<B> {
@ -107,7 +107,7 @@ impl<B: MessageBody> MessageBody for EncoderBody<B> {
}
}
EncoderBody::Stream(b) => b.poll_next(cx),
EncoderBody::BoxedStream(b) => b.poll_next(cx),
EncoderBody::BoxedStream(ref mut b) => Pin::new(b.as_mut()).poll_next(cx),
}
}
}