Skip to content

Commit

Permalink
Rollup merge of rust-lang#80985 - ijackson:slice-strip-fix, r=jyn514
Browse files Browse the repository at this point in the history
Fix stabilisation version of slice_strip

See rust-lang#77853 (review)

Signed-off-by: Ian Jackson <[email protected]>
  • Loading branch information
JohnTitor authored Jan 14, 2021
2 parents 30ec4de + b59fa3d commit 8278100
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1877,7 +1877,7 @@ impl<T> [T] {
/// Some(b"llo".as_ref()));
/// ```
#[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]>
where
T: PartialEq,
Expand Down Expand Up @@ -1911,7 +1911,7 @@ impl<T> [T] {
/// assert_eq!(v.strip_suffix(&[50, 30]), None);
/// ```
#[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]>
where
T: PartialEq,
Expand Down Expand Up @@ -3323,7 +3323,7 @@ pub trait SlicePattern {
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] {
type Item = T;

Expand All @@ -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] {
type Item = T;

Expand Down

0 comments on commit 8278100

Please sign in to comment.