about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLéo Lanteri Thauvin <leseulartichaut@gmail.com>2021-08-25 15:48:55 +0200
committerGitHub <noreply@github.com>2021-08-25 15:48:55 +0200
commit33752837631c629f820406f9dba9fc45cdee46a5 (patch)
treeea5cf6d421cf4d8cb591490766754184052cb3c6
parent069330633ec243b49f1da1b546667306044d8bc9 (diff)
parentbc33861c2240c966e01d6f3e0431d192c9c720c1 (diff)
downloadrust-33752837631c629f820406f9dba9fc45cdee46a5.tar.gz
rust-33752837631c629f820406f9dba9fc45cdee46a5.zip
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`
-rw-r--r--library/core/src/iter/traits/iterator.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs
index 75987d18fe0..850435b53cc 100644
--- a/library/core/src/iter/traits/iterator.rs
+++ b/library/core/src/iter/traits/iterator.rs
@@ -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;