File tree 2 files changed +6
-11
lines changed
2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,11 @@ where
62
62
S : Stream < Item = I > ,
63
63
{
64
64
match first. poll_next ( cx) {
65
- Poll :: Ready ( Some ( item) ) => Poll :: Ready ( Some ( item) ) ,
66
65
Poll :: Ready ( None ) => second. poll_next ( cx) ,
66
+ Poll :: Ready ( item) => Poll :: Ready ( item) ,
67
67
Poll :: Pending => match second. poll_next ( cx) {
68
- Poll :: Ready ( Some ( item) ) => Poll :: Ready ( Some ( item) ) ,
69
- Poll :: Ready ( None ) => Poll :: Pending ,
70
- Poll :: Pending => Poll :: Pending ,
68
+ Poll :: Ready ( None ) | Poll :: Pending => Poll :: Pending ,
69
+ Poll :: Ready ( item) => Poll :: Ready ( item) ,
71
70
} ,
72
71
}
73
72
}
Original file line number Diff line number Diff line change @@ -1663,18 +1663,14 @@ extension_trait! {
1663
1663
```
1664
1664
# async_std::task::block_on(async {
1665
1665
use async_std::prelude::*;
1666
- use async_std::stream;
1666
+ use async_std::stream::{self, FromStream} ;
1667
1667
1668
1668
let a = stream::once(1u8);
1669
1669
let b = stream::once(2u8);
1670
1670
let c = stream::once(3u8);
1671
1671
1672
- let mut s = a.merge(b).merge(c);
1673
- let mut lst = Vec::new();
1674
-
1675
- while let Some(n) = s.next().await {
1676
- lst.push(n)
1677
- }
1672
+ let s = a.merge(b).merge(c);
1673
+ let mut lst = Vec::from_stream(s).await;
1678
1674
1679
1675
lst.sort_unstable();
1680
1676
assert_eq!(&lst, &[1u8, 2u8, 3u8]);
You can’t perform that action at this time.
0 commit comments