fix memstream impl
This commit is contained in:
parent
de17c738d2
commit
2650a96d16
1 changed files with 1 additions and 5 deletions
6
src/cache/mod.rs
vendored
6
src/cache/mod.rs
vendored
|
@ -188,11 +188,7 @@ impl Stream for MemStream {
|
||||||
fn poll_next(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
fn poll_next(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<Self::Item>> {
|
||||||
let mut new_bytes = Bytes::new();
|
let mut new_bytes = Bytes::new();
|
||||||
std::mem::swap(&mut self.0, &mut new_bytes);
|
std::mem::swap(&mut self.0, &mut new_bytes);
|
||||||
if new_bytes.is_empty() {
|
Poll::Ready(Some(Ok(new_bytes)))
|
||||||
Poll::Ready(None)
|
|
||||||
} else {
|
|
||||||
Poll::Ready(Some(Ok(new_bytes)))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue