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
+1 -1
View File
@@ -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 }
}