From a69b3a8a9e215c689bfde3e07d5b50fe2ecc08e7 Mon Sep 17 00:00:00 2001 From: yjhmelody <465402634@qq.com> Date: Sat, 16 Nov 2019 00:54:50 +0800 Subject: [PATCH] use `as_mut` for stream-partition --- src/stream/stream/partition.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/stream/stream/partition.rs b/src/stream/stream/partition.rs index ba4938c..7374456 100644 --- a/src/stream/stream/partition.rs +++ b/src/stream/stream/partition.rs @@ -45,13 +45,11 @@ where match next { Some(v) => { - let mut res = this.res.take().unwrap(); + let res = this.res.as_mut().unwrap(); match (this.f)(&v) { true => res.0.extend(Some(v)), false => res.1.extend(Some(v)), }; - - *this.res = Some(res); } None => return Poll::Ready(this.res.take().unwrap()), }