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

inline trivial body methods

This commit is contained in:
Rob Ede
2021-12-11 16:05:08 +00:00
parent 5b0a50249b
commit b41b346c00
6 changed files with 42 additions and 5 deletions

View File

@@ -27,6 +27,7 @@ where
S: Stream<Item = Result<Bytes, E>>,
E: Into<Box<dyn StdError>> + 'static,
{
#[inline]
pub fn new(size: u64, stream: S) -> Self {
SizedStream { size, stream }
}
@@ -41,6 +42,7 @@ where
{
type Error = E;
#[inline]
fn size(&self) -> BodySize {
BodySize::Sized(self.size as u64)
}