Merge pull request #545 from yjhmelody/stream-partition-patch

use `as_mut` for stream-partition
new-scheduler
Yoshua Wuyts 5 years ago committed by GitHub
commit ee23ba6e94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -45,13 +45,11 @@ where
match next { match next {
Some(v) => { Some(v) => {
let mut res = this.res.take().unwrap(); let res = this.res.as_mut().unwrap();
match (this.f)(&v) { match (this.f)(&v) {
true => res.0.extend(Some(v)), true => res.0.extend(Some(v)),
false => res.1.extend(Some(v)), false => res.1.extend(Some(v)),
}; };
*this.res = Some(res);
} }
None => return Poll::Ready(this.res.take().unwrap()), None => return Poll::Ready(this.res.take().unwrap()),
} }

Loading…
Cancel
Save