From 7d616c695d627aa9465a8c8c17b7cadc3f3cb886 Mon Sep 17 00:00:00 2001 From: k-nasa Date: Sat, 16 Nov 2019 01:54:09 +0900 Subject: [PATCH] refactor: change to as_mut --- src/stream/stream/partition.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/stream/stream/partition.rs b/src/stream/stream/partition.rs index 077d4ec2..74231ab7 100644 --- a/src/stream/stream/partition.rs +++ b/src/stream/stream/partition.rs @@ -44,15 +44,12 @@ where match next { Some(v) => { - let mut res = this.res.take().unwrap(); - + let res = this.res.as_mut().unwrap(); if (this.f)(&v) { res.0.extend(Some(v)) } else { res.1.extend(Some(v)) } - - *this.res = Some(res); } None => return Poll::Ready(this.res.take().unwrap()), }