Skip to content

Commit

Permalink
Rollup merge of rust-lang#88273 - jhpratt:update-iterator-docs, r=jyn514
Browse files Browse the repository at this point in the history
Fix references to `ControlFlow` in docs

The `Iterator::for_each` method previously stated that it was not possible to use `break` and `continue` in it — this has been updated to acknowledge the stabilization of `ControlFlow`. Additionally, `ControlFlow` was referred to as `crate::ops::ControlFlow` which is not the correct path for an end user.

r? `@jyn514`
  • Loading branch information
LeSeulArtichaut authored Aug 25, 2021
2 parents 0693306 + bc33861 commit 3375283
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1957,8 +1957,8 @@ pub trait Iterator {
/// assert_eq!(it.next(), Some(&40));
/// ```
///
/// While you cannot `break` from a closure, the [`crate::ops::ControlFlow`]
/// type allows a similar idea:
/// While you cannot `break` from a closure, the [`ControlFlow`] type allows
/// a similar idea:
///
/// ```
/// use std::ops::ControlFlow;
Expand Down Expand Up @@ -2024,8 +2024,8 @@ pub trait Iterator {
/// assert_eq!(it.next(), Some("stale_bread.json"));
/// ```
///
/// The [`crate::ops::ControlFlow`] type can be used with this method for the
/// situations in which you'd use `break` and `continue` in a normal loop:
/// The [`ControlFlow`] type can be used with this method for the situations
/// in which you'd use `break` and `continue` in a normal loop:
///
/// ```
/// use std::ops::ControlFlow;
Expand Down

0 comments on commit 3375283

Please sign in to comment.