Skip to content

Commit

Permalink
Merge pull request #997 from dmitris/fixdoc
Browse files Browse the repository at this point in the history
stream: correct iterators in doc examples
  • Loading branch information
yoshuawuyts authored Nov 10, 2021
2 parents f4b8c7a + 5e8d1e6 commit 69bb5cf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
//! #
//! # use async_std::prelude::*;
//! # use async_std::stream;
//! let mut values = stream::repeat(1u8).take(5);
//! let mut values = stream::from_iter(1u8..6);
//!
//! while let Some(x) = values.next().await {
//! println!("{}", x);
Expand All @@ -183,7 +183,8 @@
//!
//! Unlike `std::iter::IntoIterator`, `IntoStream` does not have compiler
//! support yet. This means that automatic conversions like with `for` loops
//! doesn't occur yet, and `into_stream` will always have to be called manually.
//! doesn't occur yet, and `into_stream` or `from_iter` as above will always
//! have to be called manually.
//!
//! [`IntoStream`]: trait.IntoStream.html
//! [`into_stream`]: trait.IntoStream.html#tymethod.into_stream
Expand Down Expand Up @@ -271,7 +272,7 @@
//! #
//! # use async_std::prelude::*;
//! # use async_std::stream;
//! let numbers = stream::repeat(1u8);
//! let numbers = stream::from_iter(0u8..);
//! let mut five_numbers = numbers.take(5);
//!
//! while let Some(number) = five_numbers.next().await {
Expand Down

0 comments on commit 69bb5cf

Please sign in to comment.