-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.
Milestone
Description
Feature gate: #![feature(iter_repeat_n)]
This is a tracking issue for the iter::repeat_n function and its associated iter::RepeatN type.
This is like repeat, but count-limited so it can re-use the buffer when generating the last item.
ACP rust-lang/libs-team#120 is still open, but I'm sending a PR for it anyway as part of fixing a bug in VecDeque.
Public API
// core::iter
fn repeat_n<T>(element: T, count: usize) -> RepeatN<T>;
pub struct RepeatN<T>(…);
impl<T: Clone> Iterator for RepeatN<T> { … }
impl<T: Clone> DoubleEndedIterator for RepeatN<T> { … }
impl<T: Clone> ExactSizeIterator for RepeatN<T> { … }
impl<T: Clone> FusedIterator for RepeatN<T> { … }
impl<T: Clone> TrustedLen for RepeatN<T> { … }Steps / History
- Implementation as
doc(hidden):VecDeque::resizeshould re-use the buffer in the passed-in element #104435 - ACP: ACP: Uplift
iter::repeat_nfrom itertools libs-team#120 - Un-hidden: Un-hide
iter::repeat_n#120045 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
kornelski, zjp-CN, stepantubanov, MortenLohne and acshi
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.This issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.The final comment period is finished for this PR / Issue.