2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-01-16 18:59:55 +00:00

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

use `as_mut` for stream-partition
This commit is contained in:
Yoshua Wuyts 2019-11-15 18:08:51 +01:00 committed by GitHub
commit ee23ba6e94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()),
}