diff options
| author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2020-12-27 01:13:21 +0000 |
|---|---|---|
| committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2020-12-27 01:15:26 +0000 |
| commit | 03b4ea463a8b2e45032e9cd6f7e293561b01c3ce (patch) | |
| tree | 27c6ad42759eec455508533c432ab0879ab15d33 | |
| parent | beb293d5dfeb17e3dcf1ed348a665f33861691fe (diff) | |
| download | rust-03b4ea463a8b2e45032e9cd6f7e293561b01c3ce.tar.gz rust-03b4ea463a8b2e45032e9cd6f7e293561b01c3ce.zip | |
Mark SlicePattern trait uses as ?Sized
This trait is ?Sized and is often slices. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
| -rw-r--r-- | library/core/src/slice/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 1ab7d68805a..23830548f68 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -1786,7 +1786,7 @@ impl<T> [T] { /// ``` #[must_use = "returns the subslice without modifying the original"] #[stable(feature = "slice_strip", since = "1.50.0")] - pub fn strip_prefix<P: SlicePattern<Item = T>>(&self, prefix: &P) -> Option<&[T]> + pub fn strip_prefix<P: SlicePattern<Item = T> + ?Sized>(&self, prefix: &P) -> Option<&[T]> where T: PartialEq, { @@ -1820,7 +1820,7 @@ impl<T> [T] { /// ``` #[must_use = "returns the subslice without modifying the original"] #[stable(feature = "slice_strip", since = "1.50.0")] - pub fn strip_suffix<P: SlicePattern<Item = T>>(&self, suffix: &P) -> Option<&[T]> + pub fn strip_suffix<P: SlicePattern<Item = T> + ?Sized>(&self, suffix: &P) -> Option<&[T]> where T: PartialEq, { |
