File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -1067,14 +1067,11 @@ impl<T> [T] {
10671067 pub fn array_chunks_mut < const N : usize > ( & mut self ) -> ArrayChunksMut < ' _ , T , N > {
10681068 assert_ne ! ( N , 0 ) ;
10691069 let len = self . len ( ) / N ;
1070- let ( fst_ptr, snd) = {
1071- // Scope the first slice into a pointer to avoid aliasing the new slice below.
1072- let ( fst, snd) = self . split_at_mut ( len * N ) ;
1073- ( fst. as_mut_ptr ( ) , snd)
1074- } ;
1070+ let ( fst, snd) = self . split_at_mut ( len * N ) ;
10751071 // SAFETY: We cast a slice of `len * N` elements into
10761072 // a slice of `len` many `N` elements chunks.
1077- let array_slice: & mut [ [ T ; N ] ] = unsafe { from_raw_parts_mut ( fst_ptr. cast ( ) , len) } ;
1073+ let array_slice: & mut [ [ T ; N ] ] =
1074+ unsafe { from_raw_parts_mut ( fst. as_mut_ptr ( ) . cast ( ) , len) } ;
10781075 ArrayChunksMut { iter : array_slice. iter_mut ( ) , rem : snd }
10791076 }
10801077
You can’t perform that action at this time.
0 commit comments