File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -1067,14 +1067,11 @@ impl<T> [T] {
1067
1067
pub fn array_chunks_mut < const N : usize > ( & mut self ) -> ArrayChunksMut < ' _ , T , N > {
1068
1068
assert_ne ! ( N , 0 ) ;
1069
1069
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 ) ;
1075
1071
// SAFETY: We cast a slice of `len * N` elements into
1076
1072
// 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) } ;
1078
1075
ArrayChunksMut { iter : array_slice. iter_mut ( ) , rem : snd }
1079
1076
}
1080
1077
You can’t perform that action at this time.
0 commit comments