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 164
164
//! #
165
165
//! # use async_std::prelude::*;
166
166
//! # use async_std::stream;
167
- //! let mut values = stream::repeat (1u8).take(5 );
167
+ //! let mut values = stream::from_iter (1u8..6 );
168
168
//!
169
169
//! while let Some(x) = values.next().await {
170
170
//! println!("{}", x);
183
183
//!
184
184
//! Unlike `std::iter::IntoIterator`, `IntoStream` does not have compiler
185
185
//! 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.
187
188
//!
188
189
//! [`IntoStream`]: trait.IntoStream.html
189
190
//! [`into_stream`]: trait.IntoStream.html#tymethod.into_stream
271
272
//! #
272
273
//! # use async_std::prelude::*;
273
274
//! # use async_std::stream;
274
- //! let numbers = stream::repeat(1u8 );
275
+ //! let numbers = stream::from_iter(0u8.. );
275
276
//! let mut five_numbers = numbers.take(5);
276
277
//!
277
278
//! while let Some(number) = five_numbers.next().await {
You can’t perform that action at this time.
0 commit comments