diff --git a/actix-http/examples/echo.rs b/actix-http/examples/echo.rs
index 3d57a472a..b2b88a7ea 100644
--- a/actix-http/examples/echo.rs
+++ b/actix-http/examples/echo.rs
@@ -17,23 +17,18 @@ async fn main() -> io::Result<()> {
HttpService::build()
.client_timeout(1000)
.client_disconnect(1000)
- .finish(|mut req: Request| {
- async move {
- let mut body = BytesMut::new();
- while let Some(item) = req.payload().next().await {
- body.extend_from_slice(&item?);
- }
-
- info!("request body: {:?}", body);
- Ok::<_, Error>(
- Response::Ok()
- .header(
- "x-head",
- HeaderValue::from_static("dummy value!"),
- )
- .body(body),
- )
+ .finish(|mut req: Request| async move {
+ let mut body = BytesMut::new();
+ while let Some(item) = req.payload().next().await {
+ body.extend_from_slice(&item?);
}
+
+ info!("request body: {:?}", body);
+ Ok::<_, Error>(
+ Response::Ok()
+ .header("x-head", HeaderValue::from_static("dummy value!"))
+ .body(body),
+ )
})
.tcp()
})?
diff --git a/actix-http/src/body.rs b/actix-http/src/body.rs
index 912f22e33..c581db604 100644
--- a/actix-http/src/body.rs
+++ b/actix-http/src/body.rs
@@ -36,7 +36,10 @@ impl BodySize {
pub trait MessageBody {
fn size(&self) -> BodySize;
- fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll