Skip to content
/ rust Public
forked from rust-lang/rust

Commit 6243c0f

Browse files
committed
Clarified the documentation on core::iter::from_fn and core::iter::successors
1 parent 8417f83 commit 6243c0f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

library/core/src/iter/sources/from_fn.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use crate::fmt;
33
/// Creates a new iterator where each iteration calls the provided closure
44
/// `F: FnMut() -> Option<T>`.
55
///
6+
/// The iterator will yield the `T`s returned from the closure.
7+
///
68
/// This allows creating a custom iterator with any behavior
79
/// without using the more verbose syntax of creating a dedicated type
810
/// and implementing the [`Iterator`] trait for it.

library/core/src/iter/sources/successors.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::iter::FusedIterator;
55
///
66
/// The iterator starts with the given first item (if any)
77
/// and calls the given `FnMut(&T) -> Option<T>` closure to compute each item’s successor.
8+
/// The iterator will yield the `T`s returned from the closure.
89
///
910
/// ```
1011
/// use std::iter::successors;

0 commit comments

Comments
 (0)