mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 12:39:31 +03:00
fix a comment in std::iter::successors
The `unfold` function have since been renamed to `from_fn`.
This commit is contained in:
@@ -17,7 +17,7 @@ pub fn successors<T, F>(first: Option<T>, succ: F) -> Successors<T, F>
|
||||
F: FnMut(&T) -> Option<T>,
|
||||
{
|
||||
// If this function returned `impl Iterator<Item=T>`
|
||||
// it could be based on `unfold` and not need a dedicated type.
|
||||
// it could be based on `from_fn` and not need a dedicated type.
|
||||
// However having a named `Successors<T, F>` type allows it to be `Clone` when `T` and `F` are.
|
||||
Successors { next: first, succ }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user