File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change 305305//! successfully for any infinite iterators.
306306//!
307307//! ```no_run
308- //! let positives = 1..;
309- //! let least = positives.min().unwrap(); // Oh no! An infinite loop!
310- //! // `positives.min` will either overflow and panic (in debug mode),
311- //! // or cause an infinite loop (in release mode), so we won't reach
312- //! // this point!
313- //! println!("The least positive number is {}.", least);
308+ //! let ones = std::iter::repeat(1);
309+ //! let least = ones.min().unwrap(); // Oh no! An infinite loop!
310+ //! // `ones.min()` causes an infinite loop, so we won't reach this point!
311+ //! println!("The smallest number one is {}.", least);
314312//! ```
315313//!
316314//! [`take`]: trait.Iterator.html#method.take
You can’t perform that action at this time.
0 commit comments