Tracking Issue for `VecDeque::truncate_to_range`
Open
Nobody has claimed this yet.
C-tracking-issue
S-tracking-unimplemented
T-libs
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.2k
- PR merge metrics
- PR metrics pending
Description
Feature gate: #![feature(vec_deque_truncate_to_range)]
This is a tracking issue for adding truncate_to_range to VecDeque.
This function can truncate both ends of a VecDeque, keeping only the specified range in the middle. This operation is O(1) if there is no Drop code.
metrics.truncate_to_range(start..end);
// is equivalent to
metrics.truncate(end);
metrics.truncate_front(metrics.len() - start);
Public API
impl<T, A: Allocator> VecDeque<T, A> {
pub fn truncate_to_range<R>(&mut self, range: R)
where
R: RangeBounds<usize>;
}
Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- ACP: https://github.com/rust-lang/libs-team/issues/785
- Implementation: https://github.com/rust-lang/rust/pull/156220
- Final comment period (FCP)^1
- Stabilization PR
Unresolved Questions
- Name. Should this be
truncate_to_range, orretain_range?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the VecDeque::truncate_to_range public API and the Steps / History checklist, then review the linked implementation PR 156220. The remaining work is to resolve the naming question and complete the final comment period and stabilization process.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100