1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-20 04:35:38 +02:00

move response builder code to own file

This commit is contained in:
Rob Ede
2021-04-14 02:12:47 +01:00
parent 23e0c9b6e0
commit 387c229f28
4 changed files with 517 additions and 404 deletions

View File

@@ -56,7 +56,7 @@ pub async fn to_bytes(body: impl MessageBody) -> Result<Bytes, crate::Error> {
let body = body.as_mut();
match ready!(body.poll_next(cx)) {
Some(Ok(bytes)) => buf.extend(bytes),
Some(Ok(bytes)) => buf.extend_from_slice(&*bytes),
None => return Poll::Ready(Ok(())),
Some(Err(err)) => return Poll::Ready(Err(err)),
}