diff options
| author | Marijn Schouten <mhkbst@gmail.com> | 2025-07-03 14:39:27 +0000 |
|---|---|---|
| committer | Marijn Schouten <mhkbst@gmail.com> | 2025-07-03 14:39:27 +0000 |
| commit | d3f2e2ec6eead8ba698aeda5967a1f4578e904b2 (patch) | |
| tree | 6e3e046086c181b630d5f28883ddde2004276e4e | |
| parent | f51c9870bab634afb9e7a262b6ca7816bb9e940d (diff) | |
| download | rust-d3f2e2ec6eead8ba698aeda5967a1f4578e904b2.tar.gz rust-d3f2e2ec6eead8ba698aeda5967a1f4578e904b2.zip | |
simplify receivers for some array method calls
| -rw-r--r-- | library/core/src/array/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 5a46c04527b..16356f749c9 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -707,7 +707,7 @@ impl<T, const N: usize> [T; N] { )] #[inline] pub fn split_array_ref<const M: usize>(&self) -> (&[T; M], &[T]) { - (&self[..]).split_first_chunk::<M>().unwrap() + self.split_first_chunk::<M>().unwrap() } /// Divides one mutable array reference into two at an index. @@ -740,7 +740,7 @@ impl<T, const N: usize> [T; N] { )] #[inline] pub fn split_array_mut<const M: usize>(&mut self) -> (&mut [T; M], &mut [T]) { - (&mut self[..]).split_first_chunk_mut::<M>().unwrap() + self.split_first_chunk_mut::<M>().unwrap() } /// Divides one array reference into two at an index from the end. @@ -785,7 +785,7 @@ impl<T, const N: usize> [T; N] { )] #[inline] pub fn rsplit_array_ref<const M: usize>(&self) -> (&[T], &[T; M]) { - (&self[..]).split_last_chunk::<M>().unwrap() + self.split_last_chunk::<M>().unwrap() } /// Divides one mutable array reference into two at an index from the end. @@ -818,7 +818,7 @@ impl<T, const N: usize> [T; N] { )] #[inline] pub fn rsplit_array_mut<const M: usize>(&mut self) -> (&mut [T], &mut [T; M]) { - (&mut self[..]).split_last_chunk_mut::<M>().unwrap() + self.split_last_chunk_mut::<M>().unwrap() } } |
