From 2650a96d161fb470d621becc5c26fb5801551671 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Sun, 18 Apr 2021 17:17:31 -0400 Subject: [PATCH] fix memstream impl --- src/cache/mod.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cache/mod.rs b/src/cache/mod.rs index 5055d60..22e7f0d 100644 --- a/src/cache/mod.rs +++ b/src/cache/mod.rs @@ -188,11 +188,7 @@ impl Stream for MemStream { fn poll_next(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll> { 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))) } }