Skip to content

Commit

Permalink
Rollup merge of rust-lang#115588 - tifv:fix-comment-successors, r=sco…
Browse files Browse the repository at this point in the history
…ttmcm

Fix a comment in std::iter::successors

The `unfold` function have since rust-lang#58062 been renamed to `from_fn`.
(I'm not sure if this whole comment is still useful—it's not like there are many iterators that *can't* be based on `from_fn`. Anyway, in its current form this comment is not correct, and it sent me into a half-hour research of what happened to `unfold` function, so I want to do *something* with it 🙃 deleting these three lines is a perfectly fine alternative, in my opinion.)
  • Loading branch information
GuillaumeGomez authored Oct 6, 2023
2 parents b75bf94 + 71429f5 commit 25ee821
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 25ee821

Please sign in to comment.