Skip to content

Commit 3375283

Browse files
Rollup merge of #88273 - jhpratt:update-iterator-docs, r=jyn514
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`
2 parents 0693306 + bc33861 commit 3375283

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

library/core/src/iter/traits/iterator.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1957,8 +1957,8 @@ pub trait Iterator {
19571957
/// assert_eq!(it.next(), Some(&40));
19581958
/// ```
19591959
///
1960-
/// While you cannot `break` from a closure, the [`crate::ops::ControlFlow`]
1961-
/// type allows a similar idea:
1960+
/// While you cannot `break` from a closure, the [`ControlFlow`] type allows
1961+
/// a similar idea:
19621962
///
19631963
/// ```
19641964
/// use std::ops::ControlFlow;
@@ -2024,8 +2024,8 @@ pub trait Iterator {
20242024
/// assert_eq!(it.next(), Some("stale_bread.json"));
20252025
/// ```
20262026
///
2027-
/// The [`crate::ops::ControlFlow`] type can be used with this method for the
2028-
/// situations in which you'd use `break` and `continue` in a normal loop:
2027+
/// The [`ControlFlow`] type can be used with this method for the situations
2028+
/// in which you'd use `break` and `continue` in a normal loop:
20292029
///
20302030
/// ```
20312031
/// use std::ops::ControlFlow;

0 commit comments

Comments
 (0)