-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-sliceArea: `[T]`Area: `[T]`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(slice_take)]
Public API
impl<T> [T] {
fn split_off<'a, R: OneSidedRange<usize>>(self: &mut &'a Self, range: R) -> Option<&'a Self>;
fn split_off_mut<'a, R: OneSidedRange<usize>>(self: &mut &'a mut Self, range: R) -> Option<&'a mut Self>;
fn split_off_first<'a>(self: &mut &'a Self) -> Option<&'a T>;
fn split_off_first_mut<'a>(self: &mut &'a mut Self) -> Option<&'a mut T>;
fn split_off_last<'a>(self: &mut &'a Self) -> Option<&'a T>;
fn split_off_last_mut<'a>(self: &mut &'a mut Self) -> Option<&'a mut T>;
}
// core::ops
trait OneSidedRange<T: ?Sized>: RangeBounds<T> {}
impl<T> OneSidedRange<T> for RangeTo<T> where Self: RangeBounds<T>;
impl<T> OneSidedRange<T> for RangeFrom<T> where Self: RangeBounds<T>;
impl<T> OneSidedRange<T> for RangeToInclusive<T> where Self: RangeBounds<T>;
Steps / History
- Introduce <&[_]>::split_off and <&str>::split_off #49173
- Add
take_...
functions to slices #62282 - Take 2: Add
take_...
functions to slices #77065 - Add slice take methods #88502
- Rename
slice::take...
methods tosplit_off...
#136555 - Final comment period (FCP)
- Stabilization PR
Unresolved Questions
zopsicle, lowlevl, jamen, FireFragment, xy2i and 26 more
Metadata
Metadata
Assignees
Labels
A-sliceArea: `[T]`Area: `[T]`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.