about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-07-04 05:47:26 +0200
committerGitHub <noreply@github.com>2025-07-04 05:47:26 +0200
commite55514bbbe988f387bcf16b496cc3f1112e4e3e9 (patch)
tree5bcc374741749f581df0c1d02ea8b8064196eb72
parent5adf3ef3392600acc55a11054d2a75bf7f40a13e (diff)
parentd3f2e2ec6eead8ba698aeda5967a1f4578e904b2 (diff)
downloadrust-e55514bbbe988f387bcf16b496cc3f1112e4e3e9.tar.gz
rust-e55514bbbe988f387bcf16b496cc3f1112e4e3e9.zip
Rollup merge of #143378 - hkBst:clippy-fix-6, r=tgross35
simplify receivers for some array method calls
-rw-r--r--library/core/src/array/mod.rs8
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()
     }
 }