Tracking Issue for slice_split_once (original) (raw)
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(&self, pred: F) -> Option<(&[T], &[T])> where F: FnMut(&T) -> bool; pub fn rsplit_once(&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_once and slice::rsplit_once #112818
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- Should we include
split_once_mutandrsplit_once_mut?