From adedad1c77c0c4b4bae7ea96c16e0ac6e1f20e8f Mon Sep 17 00:00:00 2001 From: Eyal Kalderon Date: Thu, 31 Jan 2019 18:23:42 +0800 Subject: [PATCH] Use set() over take() to ensure sink is dropped --- futures-util/src/stream/forward.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/futures-util/src/stream/forward.rs b/futures-util/src/stream/forward.rs index 9aad75bc70..f53b345d97 100644 --- a/futures-util/src/stream/forward.rs +++ b/futures-util/src/stream/forward.rs @@ -85,7 +85,7 @@ where Poll::Ready(None) => { try_ready!(self.as_mut().sink().as_pin_mut().expect(INVALID_POLL) .poll_flush(lw)); - let _ = self.as_mut().sink().as_pin_mut().take().unwrap(); + self.as_mut().sink().set(None); return Poll::Ready(Ok(())) } Poll::Pending => {