Fix stabilisation version of slice_strip
See https://github.com/rust-lang/rust/pull/77853#pullrequestreview-564921079 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
This commit is contained in:
parent
9f3998b4aa
commit
b59fa3d634
@ -1877,7 +1877,7 @@ impl<T> [T] {
|
|||||||
/// Some(b"llo".as_ref()));
|
/// Some(b"llo".as_ref()));
|
||||||
/// ```
|
/// ```
|
||||||
#[must_use = "returns the subslice without modifying the original"]
|
#[must_use = "returns the subslice without modifying the original"]
|
||||||
#[stable(feature = "slice_strip", since = "1.50.0")]
|
#[stable(feature = "slice_strip", since = "1.51.0")]
|
||||||
pub fn strip_prefix<P: SlicePattern<Item = T> + ?Sized>(&self, prefix: &P) -> Option<&[T]>
|
pub fn strip_prefix<P: SlicePattern<Item = T> + ?Sized>(&self, prefix: &P) -> Option<&[T]>
|
||||||
where
|
where
|
||||||
T: PartialEq,
|
T: PartialEq,
|
||||||
@ -1911,7 +1911,7 @@ impl<T> [T] {
|
|||||||
/// assert_eq!(v.strip_suffix(&[50, 30]), None);
|
/// assert_eq!(v.strip_suffix(&[50, 30]), None);
|
||||||
/// ```
|
/// ```
|
||||||
#[must_use = "returns the subslice without modifying the original"]
|
#[must_use = "returns the subslice without modifying the original"]
|
||||||
#[stable(feature = "slice_strip", since = "1.50.0")]
|
#[stable(feature = "slice_strip", since = "1.51.0")]
|
||||||
pub fn strip_suffix<P: SlicePattern<Item = T> + ?Sized>(&self, suffix: &P) -> Option<&[T]>
|
pub fn strip_suffix<P: SlicePattern<Item = T> + ?Sized>(&self, suffix: &P) -> Option<&[T]>
|
||||||
where
|
where
|
||||||
T: PartialEq,
|
T: PartialEq,
|
||||||
@ -3323,7 +3323,7 @@ pub trait SlicePattern {
|
|||||||
fn as_slice(&self) -> &[Self::Item];
|
fn as_slice(&self) -> &[Self::Item];
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "slice_strip", since = "1.50.0")]
|
#[stable(feature = "slice_strip", since = "1.51.0")]
|
||||||
impl<T> SlicePattern for [T] {
|
impl<T> SlicePattern for [T] {
|
||||||
type Item = T;
|
type Item = T;
|
||||||
|
|
||||||
@ -3333,7 +3333,7 @@ impl<T> SlicePattern for [T] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[stable(feature = "slice_strip", since = "1.50.0")]
|
#[stable(feature = "slice_strip", since = "1.51.0")]
|
||||||
impl<T, const N: usize> SlicePattern for [T; N] {
|
impl<T, const N: usize> SlicePattern for [T; N] {
|
||||||
type Item = T;
|
type Item = T;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user