Skip to content

Commit 03b4ea4

Browse files
committed
Mark SlicePattern trait uses as ?Sized
This trait is ?Sized and is often slices. Signed-off-by: Ian Jackson <[email protected]>
1 parent beb293d commit 03b4ea4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/slice/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,7 @@ impl<T> [T] {
17861786
/// ```
17871787
#[must_use = "returns the subslice without modifying the original"]
17881788
#[stable(feature = "slice_strip", since = "1.50.0")]
1789-
pub fn strip_prefix<P: SlicePattern<Item = T>>(&self, prefix: &P) -> Option<&[T]>
1789+
pub fn strip_prefix<P: SlicePattern<Item = T> + ?Sized>(&self, prefix: &P) -> Option<&[T]>
17901790
where
17911791
T: PartialEq,
17921792
{
@@ -1820,7 +1820,7 @@ impl<T> [T] {
18201820
/// ```
18211821
#[must_use = "returns the subslice without modifying the original"]
18221822
#[stable(feature = "slice_strip", since = "1.50.0")]
1823-
pub fn strip_suffix<P: SlicePattern<Item = T>>(&self, suffix: &P) -> Option<&[T]>
1823+
pub fn strip_suffix<P: SlicePattern<Item = T> + ?Sized>(&self, suffix: &P) -> Option<&[T]>
18241824
where
18251825
T: PartialEq,
18261826
{

0 commit comments

Comments
 (0)