fix memstream impl

feature/v32-tokens
Edward Shen 2021-04-18 17:17:31 -04:00
parent de17c738d2
commit 2650a96d16
Signed by: edward
GPG Key ID: 19182661E818369F
1 changed files with 1 additions and 5 deletions

6
src/cache/mod.rs vendored
View File

@ -188,11 +188,7 @@ impl Stream for MemStream {
fn poll_next(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<Self::Item>> {
let mut new_bytes = Bytes::new();
std::mem::swap(&mut self.0, &mut new_bytes);
if new_bytes.is_empty() {
Poll::Ready(None)
} else {
Poll::Ready(Some(Ok(new_bytes)))
}
Poll::Ready(Some(Ok(new_bytes)))
}
}