Skip to content

Commit

Permalink
fix a comment in std::iter::successors
Browse files Browse the repository at this point in the history
The `unfold` function have since been renamed to `from_fn`.
  • Loading branch information
tifv authored Sep 5, 2023
1 parent f222a2d commit 71429f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/iter/sources/successors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}
Expand Down

0 comments on commit 71429f5

Please sign in to comment.