1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 00:44:26 +02:00

improve codegen on BoxBody poll_next

This commit is contained in:
Rob Ede
2021-12-17 19:19:21 +00:00
parent aa31086af5
commit 1d6f5ba6d6
3 changed files with 22 additions and 6 deletions

View File

@ -108,6 +108,7 @@ where
{
type Error = EncoderError;
#[inline]
fn size(&self) -> BodySize {
match self {
EncoderBody::None => BodySize::None,
@ -131,6 +132,7 @@ where
}
}
#[inline]
fn try_into_bytes(self) -> Result<Bytes, Self>
where
Self: Sized,
@ -149,6 +151,7 @@ where
{
type Error = EncoderError;
#[inline]
fn size(&self) -> BodySize {
if self.encoder.is_some() {
BodySize::Stream
@ -225,6 +228,7 @@ where
}
}
#[inline]
fn try_into_bytes(mut self) -> Result<Bytes, Self>
where
Self: Sized,