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:
@ -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(),
|
||||
|
Reference in New Issue
Block a user