-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stabilize iterator_repeat_with #51200
Conversation
r? @aidanhs (rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for filing this! There's a minor adjustment needed.
@@ -209,7 +199,7 @@ unsafe impl<A, F: FnMut() -> A> TrustedLen for RepeatWith<F> {} | |||
/// assert_eq!(None, pow2.next()); | |||
/// ``` | |||
#[inline] | |||
#[unstable(feature = "iterator_repeat_with", issue = "48169")] | |||
#[stable(feature = "iterator_repeat_with", since = "1.28.0")] | |||
pub fn repeat_with<A, F: FnMut() -> A>(repeater: F) -> RepeatWith<F> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is some documentation re. DEI left that needs to be removed:
An iterator produced by
repeat_with()
is aDoubleEndedIterator
. It is important to note that reversingrepeat_with(f)
will produce the exact same sequence as the non-reversed iterator. In other words,repeat_with(f).rev().collect::<Vec<_>>()
is equivalent torepeat_with(f).collect::<Vec<_>>()
.
I would replace this with a note saying that it isn't DEI and to ask users who need that to come forward and file an issue explaining their use case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
672a46a
to
87941b0
Compare
@bors r=Centril,kennytm |
📌 Commit 87941b0 has been approved by |
…nnytm Stabilize iterator_repeat_with Fixes #48169
☀️ Test successful - status-appveyor, status-travis |
Fixes #48169