File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -4893,6 +4893,28 @@ impl<T> [T] {
48934893
48944894 if start <= self . len ( ) && end <= self . len ( ) { Some ( start..end) } else { None }
48954895 }
4896+
4897+ /// Returns the same slice `&[T]`.
4898+ ///
4899+ /// This method is redundant when used directly on `&[T]`, but
4900+ /// it helps dereferencing other "container" types to slices,
4901+ /// for example `Box<[T]>` or `Arc<[T]>`.
4902+ #[ inline]
4903+ #[ unstable( feature = "thing_as_thing" , issue = "none" ) ]
4904+ pub const fn as_slice ( & self ) -> & [ T ] {
4905+ self
4906+ }
4907+
4908+ /// Returns the same slice `&mut [T]`.
4909+ ///
4910+ /// This method is redundant when used directly on `&mut [T]`, but
4911+ /// it helps dereferencing other "container" types to slices,
4912+ /// for example `Box<[T]>` or `Arc<[T]>`.
4913+ #[ inline]
4914+ #[ unstable( feature = "thing_as_thing" , issue = "none" ) ]
4915+ pub const fn as_mut_slice ( & mut self ) -> & mut [ T ] {
4916+ self
4917+ }
48964918}
48974919
48984920impl < T > [ MaybeUninit < T > ] {
You can’t perform that action at this time.
0 commit comments