- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Open
Labels
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.
Description
Feature gate: #![feature(slice_split_once)]
This is a tracking issue for the slice::split_once and slice::rsplit_once methods, which split a slice into two chunks on the first occurrence of a single-element delimiter. These mirror the existing stable str::split_once and str::rsplit_once. I expect these to be mostly used for ad-hoc parsing data that is not UTF-8.
Public API
// core::slice
impl [T] {
    pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
    where
        F: FnMut(&T) -> bool;
    pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
    where
        F: FnMut(&T) -> bool;
}Steps / History
- ACP: ACP: add slice::split_once libs-team#102
-  Implementation: Implement slice::split_onceandslice::rsplit_once#112818
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Should we include split_once_mutandrsplit_once_mut?
Footnotes
jdahlstrom, alexkazik, epidemian, Athonathonathon, ryanv404 and 20 more
Metadata
Metadata
Assignees
Labels
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.