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

use mem::take where possible (#1507)

This commit is contained in:
Rob Ede
2020-05-17 02:54:42 +01:00
committed by GitHub
parent 201090d7a2
commit f3b0233477
10 changed files with 20 additions and 32 deletions

View File

@ -106,7 +106,7 @@ impl<B: MessageBody> MessageBody for EncoderBody<B> {
if b.is_empty() {
Poll::Ready(None)
} else {
Poll::Ready(Some(Ok(std::mem::replace(b, Bytes::new()))))
Poll::Ready(Some(Ok(std::mem::take(b))))
}
}
EncoderBody::Stream(b) => b.poll_next(cx),