File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 164164//! #
165165//! # use async_std::prelude::*;
166166//! # use async_std::stream;
167- //! let mut values = stream::repeat (1u8).take(5 );
167+ //! let mut values = stream::from_iter (1u8..6 );
168168//!
169169//! while let Some(x) = values.next().await {
170170//! println!("{}", x);
183183//!
184184//! Unlike `std::iter::IntoIterator`, `IntoStream` does not have compiler
185185//! support yet. This means that automatic conversions like with `for` loops
186- //! doesn't occur yet, and `into_stream` will always have to be called manually.
186+ //! doesn't occur yet, and `into_stream` or `from_iter` as above will always
187+ //! have to be called manually.
187188//!
188189//! [`IntoStream`]: trait.IntoStream.html
189190//! [`into_stream`]: trait.IntoStream.html#tymethod.into_stream
271272//! #
272273//! # use async_std::prelude::*;
273274//! # use async_std::stream;
274- //! let numbers = stream::repeat(1u8 );
275+ //! let numbers = stream::from_iter(0u8.. );
275276//! let mut five_numbers = numbers.take(5);
276277//!
277278//! while let Some(number) = five_numbers.next().await {
You can’t perform that action at this time.
0 commit comments