Skip to content

Tracking Issue for iter::repeat_n() (feature(iter_repeat_n)) #104434

Closed
@scottmcm

Description

@scottmcm

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

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: 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.disposition-mergeThis 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.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions