about summary refs log tree commit diff
diff options
context:
space:
mode:
authorranger-ross <rosssullivan101@gmail.com>2025-01-05 17:30:32 +0900
committerranger-ross <rosssullivan101@gmail.com>2025-01-05 19:25:24 +0900
commit6243c0f818ee05b81a8e465bc3d44ae040ea14bd (patch)
tree354b478f32067c6059c2b8776aa6f9805c7c6d98
parent8417f8311fcb596030768a817e1e4eacb214b78e (diff)
downloadrust-6243c0f818ee05b81a8e465bc3d44ae040ea14bd.tar.gz
rust-6243c0f818ee05b81a8e465bc3d44ae040ea14bd.zip
Clarified the documentation on core::iter::from_fn and core::iter::successors
-rw-r--r--library/core/src/iter/sources/from_fn.rs2
-rw-r--r--library/core/src/iter/sources/successors.rs1
2 files changed, 3 insertions, 0 deletions
diff --git a/library/core/src/iter/sources/from_fn.rs b/library/core/src/iter/sources/from_fn.rs
index 3cd3830471c..5f3d404d7dc 100644
--- a/library/core/src/iter/sources/from_fn.rs
+++ b/library/core/src/iter/sources/from_fn.rs
@@ -3,6 +3,8 @@ use crate::fmt;
 /// Creates a new iterator where each iteration calls the provided closure
 /// `F: FnMut() -> Option<T>`.
 ///
+/// The iterator will yield the `T`s returned from the closure.
+///
 /// This allows creating a custom iterator with any behavior
 /// without using the more verbose syntax of creating a dedicated type
 /// and implementing the [`Iterator`] trait for it.
diff --git a/library/core/src/iter/sources/successors.rs b/library/core/src/iter/sources/successors.rs
index 36bc4035039..e14c9235e55 100644
--- a/library/core/src/iter/sources/successors.rs
+++ b/library/core/src/iter/sources/successors.rs
@@ -5,6 +5,7 @@ use crate::iter::FusedIterator;
 ///
 /// The iterator starts with the given first item (if any)
 /// and calls the given `FnMut(&T) -> Option<T>` closure to compute each item’s successor.
+/// The iterator will yield the `T`s returned from the closure.
 ///
 /// ```
 /// use std::iter::successors;