File tree Expand file tree Collapse file tree 5 files changed +20
-2
lines changed Expand file tree Collapse file tree 5 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,8 @@ impl<P: AsRef<Path>> stream::Extend<P> for PathBuf {
327327 let stream = stream. into_stream ( ) ;
328328
329329 Box :: pin ( async move {
330+ pin_utils:: pin_mut!( stream) ;
331+
330332 while let Some ( item) = stream. next ( ) . await {
331333 self . push ( item. as_ref ( ) ) ;
332334 }
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ impl<F> Unpin for FromFn<F> {}
3030/// use async_std::stream;
3131///
3232/// let mut count = 0u8;
33- /// let mut s = stream::from_fn(|| {
33+ /// let s = stream::from_fn(|| {
3434/// count += 1;
3535/// if count > 3 {
3636/// None
@@ -39,6 +39,8 @@ impl<F> Unpin for FromFn<F> {}
3939/// }
4040/// });
4141///
42+ /// pin_utils::pin_mut!(s);
43+ ///
4244/// assert_eq!(s.next().await, Some(1));
4345/// assert_eq!(s.next().await, Some(2));
4446/// assert_eq!(s.next().await, Some(3));
Original file line number Diff line number Diff line change @@ -28,7 +28,9 @@ impl<F> Unpin for RepeatWith<F> {}
2828/// use async_std::prelude::*;
2929/// use async_std::stream;
3030///
31- /// let mut s = stream::repeat_with(|| 1);
31+ /// let s = stream::repeat_with(|| 1);
32+ ///
33+ /// pin_utils::pin_mut!(s);
3234///
3335/// assert_eq!(s.next().await, Some(1));
3436/// assert_eq!(s.next().await, Some(1));
Original file line number Diff line number Diff line change @@ -13,6 +13,8 @@ impl stream::Extend<char> for String {
1313 self . reserve ( stream. size_hint ( ) . 0 ) ;
1414
1515 Box :: pin ( async move {
16+ pin_utils:: pin_mut!( stream) ;
17+
1618 while let Some ( item) = stream. next ( ) . await {
1719 self . push ( item) ;
1820 }
@@ -28,6 +30,8 @@ impl<'b> stream::Extend<&'b char> for String {
2830 let stream = stream. into_stream ( ) ;
2931
3032 Box :: pin ( async move {
33+ pin_utils:: pin_mut!( stream) ;
34+
3135 while let Some ( item) = stream. next ( ) . await {
3236 self . push ( * item) ;
3337 }
@@ -43,6 +47,8 @@ impl<'b> stream::Extend<&'b str> for String {
4347 let stream = stream. into_stream ( ) ;
4448
4549 Box :: pin ( async move {
50+ pin_utils:: pin_mut!( stream) ;
51+
4652 while let Some ( item) = stream. next ( ) . await {
4753 self . push_str ( item) ;
4854 }
@@ -58,6 +64,8 @@ impl stream::Extend<String> for String {
5864 let stream = stream. into_stream ( ) ;
5965
6066 Box :: pin ( async move {
67+ pin_utils:: pin_mut!( stream) ;
68+
6169 while let Some ( item) = stream. next ( ) . await {
6270 self . push_str ( & item) ;
6371 }
@@ -73,6 +81,8 @@ impl<'b> stream::Extend<Cow<'b, str>> for String {
7381 let stream = stream. into_stream ( ) ;
7482
7583 Box :: pin ( async move {
84+ pin_utils:: pin_mut!( stream) ;
85+
7686 while let Some ( item) = stream. next ( ) . await {
7787 self . push_str ( & item) ;
7888 }
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ impl stream::Extend<()> for () {
1111 let stream = stream. into_stream ( ) ;
1212
1313 Box :: pin ( async move {
14+ pin_utils:: pin_mut!( stream) ;
15+
1416 while let Some ( _) = stream. next ( ) . await { }
1517 } )
1618 }
You can’t perform that action at this time.
0 commit comments