The feature gate for the issue is #![feature(slice_strip)].
This feature adds two new methods to [T]:
impl<T> [T] {
/// Returns a subslice with the prefix removed.
pub fn strip_prefix(&self, prefix: &[T]) -> Option<&[T]> where T: PartialEq;
/// Returns a subslice with the suffix removed.
pub fn strip_suffix(&self, suffix: &[T]) -> Option<&[T]> where T: PartialEq;
}
This is an analogy feature like str::strip_{prefix,suffix} but has the same signature of slice's {starts,ends}_with.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also uses as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
Unresolved Questions
None
Implementation history
The feature gate for the issue is
#![feature(slice_strip)].This feature adds two new methods to
[T]:This is an analogy feature like
str::strip_{prefix,suffix}but has the same signature of slice's{starts,ends}_with.About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also uses as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
Unresolved Questions
None
Implementation history
slice_stripfeature #73414[u8]: https://rust.godbolt.org/z/iMcqf-