@@ -1038,22 +1038,22 @@ impl<T> [T] {
1038
1038
/// let slice: &mut [char] = &mut ['l', 'o', 'r', 'e', 'm', '!'];
1039
1039
/// let chunks: &mut [[char; 1]] =
1040
1040
/// // SAFETY: 1-element chunks never have remainder
1041
- /// unsafe { slice.as_chunks_mut_unchecked () };
1041
+ /// unsafe { slice.as_chunks_unchecked_mut () };
1042
1042
/// chunks[0] = ['L'];
1043
1043
/// assert_eq!(chunks, &[['L'], ['o'], ['r'], ['e'], ['m'], ['!']]);
1044
1044
/// let chunks: &mut [[char; 3]] =
1045
1045
/// // SAFETY: The slice length (6) is a multiple of 3
1046
- /// unsafe { slice.as_chunks_mut_unchecked () };
1046
+ /// unsafe { slice.as_chunks_unchecked_mut () };
1047
1047
/// chunks[1] = ['a', 'x', '?'];
1048
1048
/// assert_eq!(slice, &['L', 'o', 'r', 'a', 'x', '?']);
1049
1049
///
1050
1050
/// // These would be unsound:
1051
- /// // let chunks: &[[_; 5]] = slice.as_chunks_mut_unchecked () // The slice length is not a multiple of 5
1052
- /// // let chunks: &[[_; 0]] = slice.as_chunks_mut_unchecked () // Zero-length chunks are never allowed
1051
+ /// // let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut () // The slice length is not a multiple of 5
1052
+ /// // let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut () // Zero-length chunks are never allowed
1053
1053
/// ```
1054
1054
#[ unstable( feature = "slice_as_chunks" , issue = "74985" ) ]
1055
1055
#[ inline]
1056
- pub unsafe fn as_chunks_mut_unchecked < const N : usize > ( & mut self ) -> & mut [ [ T ; N ] ] {
1056
+ pub unsafe fn as_chunks_unchecked_mut < const N : usize > ( & mut self ) -> & mut [ [ T ; N ] ] {
1057
1057
debug_assert_ne ! ( N , 0 ) ;
1058
1058
debug_assert_eq ! ( self . len( ) % N , 0 ) ;
1059
1059
let new_len =
@@ -1096,7 +1096,7 @@ impl<T> [T] {
1096
1096
let ( multiple_of_n, remainder) = self . split_at_mut ( len * N ) ;
1097
1097
// SAFETY: We already panicked for zero, and ensured by construction
1098
1098
// that the length of the subslice is a multiple of N.
1099
- let array_slice = unsafe { multiple_of_n. as_chunks_mut_unchecked ( ) } ;
1099
+ let array_slice = unsafe { multiple_of_n. as_chunks_unchecked_mut ( ) } ;
1100
1100
( array_slice, remainder)
1101
1101
}
1102
1102
@@ -1132,7 +1132,7 @@ impl<T> [T] {
1132
1132
let ( remainder, multiple_of_n) = self . split_at_mut ( self . len ( ) - len * N ) ;
1133
1133
// SAFETY: We already panicked for zero, and ensured by construction
1134
1134
// that the length of the subslice is a multiple of N.
1135
- let array_slice = unsafe { multiple_of_n. as_chunks_mut_unchecked ( ) } ;
1135
+ let array_slice = unsafe { multiple_of_n. as_chunks_unchecked_mut ( ) } ;
1136
1136
( remainder, array_slice)
1137
1137
}
1138
1138
0 commit comments