File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -62,12 +62,11 @@ where
6262 S : Stream < Item = I > ,
6363{
6464 match first. poll_next ( cx) {
65- Poll :: Ready ( Some ( item) ) => Poll :: Ready ( Some ( item) ) ,
6665 Poll :: Ready ( None ) => second. poll_next ( cx) ,
66+ Poll :: Ready ( item) => Poll :: Ready ( item) ,
6767 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) ,
7170 } ,
7271 }
7372}
Original file line number Diff line number Diff line change @@ -1663,18 +1663,14 @@ extension_trait! {
16631663 ```
16641664 # async_std::task::block_on(async {
16651665 use async_std::prelude::*;
1666- use async_std::stream;
1666+ use async_std::stream::{self, FromStream} ;
16671667
16681668 let a = stream::once(1u8);
16691669 let b = stream::once(2u8);
16701670 let c = stream::once(3u8);
16711671
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;
16781674
16791675 lst.sort_unstable();
16801676 assert_eq!(&lst, &[1u8, 2u8, 3u8]);
You can’t perform that action at this time.
0 commit comments