- Notifications
You must be signed in to change notification settings - Fork 13.8k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Location
core::iter::from_fn
core::iter::successors
Summary
Both of these functions take callback methods that return an Option<T>
. However, nowhere is actually described that this Option<T>
is used to detect the end of the iterator (i.e. return Some
while there are items, return None
when at the end). I was able to deduce how things worked eventually by looking at the examples, but I was definitely a bit confused at first.
There should be a clear description on what the callback is expected to return, not just when the callback is called.
Scripter17
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.