feat(body): implement HttpBody for Request and Response
When the body type of a `Request` or `Response` implements `HttpBody`, the `Request` or `Response` itself now implements `HttpBody`. This allows writing things like `hyper::body::aggregate(req)` instead of `hyper::body::aggregate(req.into_body())`. Closes #2067
This commit is contained in:
@@ -1887,7 +1887,7 @@ impl tower_service::Service<Request<Body>> for TestService {
|
||||
let replies = self.reply.clone();
|
||||
|
||||
Box::pin(async move {
|
||||
while let Some(chunk) = req.body_mut().data().await {
|
||||
while let Some(chunk) = req.data().await {
|
||||
match chunk {
|
||||
Ok(chunk) => {
|
||||
tx.send(Msg::Chunk(chunk.to_vec())).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user