-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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(split_as_slice)]
This is a tracking issue for:
Converting an iterator produced by .split(...)
which is not fully consumed, into a slice, matching the APIs for .split(...)
on String
s.
Public API
let a = [1,2,3];
let mut iter = a.split(|i| i == 2);
assert!(iter.next().is_some());
assert_eq!(iter.as_slice(), &[3]);
Steps / History
- Implementation: Add core::slice::Split::as_slice #92287
- Final comment period (FCP)
- Stabilization PR
Unresolved Questions
Add impl:
#[stable(feature = "split_as_slice", since = "1.0.0")]
impl<'a, T: 'a, P: FnMut(&T) -> bool> AsRef<[T]> for Split<'a, T, P> {
fn as_ref(&self) -> &'a [T] {
self.as_slice()
}
}
a1phyr, estin, wr7 and edpytsammysheep and estin
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.