Open
Description
Feature gate: #![feature(vec_deque_iter_as_slices)]
This is a tracking issue for:
alloc::collections::vec_deque::Iter::as_slices
alloc::collections::vec_deque::IterMut::into_slices
alloc::collections::vec_deque::IterMut::as_slices
alloc::collections::vec_deque::IterMut::as_mut_slices
Each of these functions obtains a pair of slices from a VecDeque
iterator, similar to VecDeque::as_slices
.
Public API
use std::collections::vec_deque::{Iter, IterMut};
impl<'a, T> Iter<'a, T> {
pub fn as_slices(&self) -> (&'a [T], &'a [T]) { ... }
}
impl<'a, T> IterMut<'a, T> {
pub fn into_slices(self) -> (&'a mut [T], &'a mut [T]) { ... }
pub fn as_slices(&self) -> (&[T], &[T]) { ... }
pub fn as_mut_slices(&mut self) -> (&mut [T], &mut [T]) { ... }
}
Steps / History
- Implementation: Add vec_deque::Iter::as_slices and friends #123947Final comment period (FCP)1Stabilization PR
Unresolved Questions
- None yet.
Footnotes
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
recatek commentedon Mar 13, 2025
Hello! Are there any outstanding questions or obstacles to stabilizing this? I would find it very useful to have!
zopsicle commentedon Mar 13, 2025
Not as far as I am concerned. :)
recatek commentedon Mar 13, 2025
I did notice one thing which is that this uses
slice::IterMut::as_mut_slice()
which itself appears to be unstable. #93079Am I reading that correctly? If so, perhaps the
as_mut_slices
function here should be marked as unstable underslice_iter_mut_as_mut_slice
as well?zopsicle commentedon Mar 14, 2025
Plenty of stable features are implemented using unstable features. That shouldn’t be a blocker.