mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-16 08:53:35 +00:00
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`
This commit is contained in:
commit
3375283763
@ -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;
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user