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

optimize encode headers and body split

This commit is contained in:
Nikolay Kim
2019-04-07 10:03:38 -07:00
parent 68d2203dd6
commit ec09d6fbe6
2 changed files with 15 additions and 16 deletions

View File

@ -153,7 +153,7 @@ impl MessageBody for Body {
if len == 0 {
Ok(Async::Ready(None))
} else {
Ok(Async::Ready(Some(bin.split_to(len))))
Ok(Async::Ready(Some(mem::replace(bin, Bytes::new()))))
}
}
Body::Message(ref mut body) => body.poll_next(),