From d3f2e2ec6eead8ba698aeda5967a1f4578e904b2 Mon Sep 17 00:00:00 2001 From: Marijn Schouten Date: Thu, 3 Jul 2025 14:39:27 +0000 Subject: [PATCH] simplify receivers for some array method calls --- library/core/src/array/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index 5a46c04527b9e..16356f749c92b 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -707,7 +707,7 @@ impl [T; N] { )] #[inline] pub fn split_array_ref(&self) -> (&[T; M], &[T]) { - (&self[..]).split_first_chunk::().unwrap() + self.split_first_chunk::().unwrap() } /// Divides one mutable array reference into two at an index. @@ -740,7 +740,7 @@ impl [T; N] { )] #[inline] pub fn split_array_mut(&mut self) -> (&mut [T; M], &mut [T]) { - (&mut self[..]).split_first_chunk_mut::().unwrap() + self.split_first_chunk_mut::().unwrap() } /// Divides one array reference into two at an index from the end. @@ -785,7 +785,7 @@ impl [T; N] { )] #[inline] pub fn rsplit_array_ref(&self) -> (&[T], &[T; M]) { - (&self[..]).split_last_chunk::().unwrap() + self.split_last_chunk::().unwrap() } /// Divides one mutable array reference into two at an index from the end. @@ -818,7 +818,7 @@ impl [T; N] { )] #[inline] pub fn rsplit_array_mut(&mut self) -> (&mut [T], &mut [T; M]) { - (&mut self[..]).split_last_chunk_mut::().unwrap() + self.split_last_chunk_mut::().unwrap() } }