Skip to content

Tracking Issue for new VecDeque methods prepend, extend_front, splice, extend_from_within and prepend_from_within #146975

@antonilol

Description

@antonilol

Feature gate: #![feature(deque_extend_front)]

This is a tracking issue for 5 new methods on VecDeque similar to ones already on Vec or their counterparts that push to the front instead of back.

ACP: rust-lang/libs-team#658

Public API

// alloc::collections::vec_deque

impl<T> VecDeque<T> {
    // Preserves order of elements.
    pub fn prepend<I>(&mut self, other: I)
    where
        I: IntoIterator<Item = T>,
        I::Iter: DoubleEndedIterator
    {
        self.extend_front(other.into_iter().rev())
    }

    // Reverses order of elements.
    pub fn extend_front<I>(&mut self, other: I)
    where
        I: IntoIterator<Item = T>;

    pub fn splice<R, I>(&mut self, range: R, replace_with: I) -> Splice<'_, I::IntoIter, A>
    where
        R: RangeBounds<usize>,
        I: IntoIterator<Item = T>;
}

impl<T: Clone> VecDeque<T> {
    pub fn extend_from_within<R>(&mut self, src: R)
    where
        R: RangeBounds<usize>;

    // Preserves order of elements.
    pub fn prepend_from_within<R>(&mut self, src: R)
    where
        R: RangeBounds<usize>;
}

Steps / History

(Remember to update the S-tracking-* label when checking boxes.)

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 RFCS-tracking-unimplementedStatus: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions