fix a comment in std::iter::successors

The `unfold` function have since been renamed to `from_fn`.
This commit is contained in:
July Tikhonov 2023-09-05 19:46:18 +03:00 committed by GitHub
parent f222a2dd8f
commit 71429f5fd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ where
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 }
}