@@ -893,7 +893,7 @@ impl<T> [T] {
893
893
#[ stable( feature = "chunks_exact" , since = "1.31.0" ) ]
894
894
#[ inline]
895
895
pub fn chunks_exact ( & self , chunk_size : usize ) -> ChunksExact < ' _ , T > {
896
- assert_ne ! ( chunk_size, 0 ) ;
896
+ assert_ne ! ( chunk_size, 0 , "chunks cannot have a size of zero" ) ;
897
897
ChunksExact :: new ( self , chunk_size)
898
898
}
899
899
@@ -935,7 +935,7 @@ impl<T> [T] {
935
935
#[ stable( feature = "chunks_exact" , since = "1.31.0" ) ]
936
936
#[ inline]
937
937
pub fn chunks_exact_mut ( & mut self , chunk_size : usize ) -> ChunksExactMut < ' _ , T > {
938
- assert_ne ! ( chunk_size, 0 ) ;
938
+ assert_ne ! ( chunk_size, 0 , "chunks cannot have a size of zero" ) ;
939
939
ChunksExactMut :: new ( self , chunk_size)
940
940
}
941
941
@@ -1017,7 +1017,7 @@ impl<T> [T] {
1017
1017
#[ inline]
1018
1018
#[ must_use]
1019
1019
pub fn as_chunks < const N : usize > ( & self ) -> ( & [ [ T ; N ] ] , & [ T ] ) {
1020
- assert_ne ! ( N , 0 ) ;
1020
+ assert_ne ! ( N , 0 , "chunks cannot have a size of zero" ) ;
1021
1021
let len = self . len ( ) / N ;
1022
1022
let ( multiple_of_n, remainder) = self . split_at ( len * N ) ;
1023
1023
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1048,7 +1048,7 @@ impl<T> [T] {
1048
1048
#[ inline]
1049
1049
#[ must_use]
1050
1050
pub fn as_rchunks < const N : usize > ( & self ) -> ( & [ T ] , & [ [ T ; N ] ] ) {
1051
- assert_ne ! ( N , 0 ) ;
1051
+ assert_ne ! ( N , 0 , "chunks cannot have a size of zero" ) ;
1052
1052
let len = self . len ( ) / N ;
1053
1053
let ( remainder, multiple_of_n) = self . split_at ( self . len ( ) - len * N ) ;
1054
1054
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1087,7 +1087,7 @@ impl<T> [T] {
1087
1087
#[ unstable( feature = "array_chunks" , issue = "74985" ) ]
1088
1088
#[ inline]
1089
1089
pub fn array_chunks < const N : usize > ( & self ) -> ArrayChunks < ' _ , T , N > {
1090
- assert_ne ! ( N , 0 ) ;
1090
+ assert_ne ! ( N , 0 , "chunks cannot have a size of zero" ) ;
1091
1091
ArrayChunks :: new ( self )
1092
1092
}
1093
1093
@@ -1166,7 +1166,7 @@ impl<T> [T] {
1166
1166
#[ inline]
1167
1167
#[ must_use]
1168
1168
pub fn as_chunks_mut < const N : usize > ( & mut self ) -> ( & mut [ [ T ; N ] ] , & mut [ T ] ) {
1169
- assert_ne ! ( N , 0 ) ;
1169
+ assert_ne ! ( N , 0 , "chunks cannot have a size of zero" ) ;
1170
1170
let len = self . len ( ) / N ;
1171
1171
let ( multiple_of_n, remainder) = self . split_at_mut ( len * N ) ;
1172
1172
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1203,7 +1203,7 @@ impl<T> [T] {
1203
1203
#[ inline]
1204
1204
#[ must_use]
1205
1205
pub fn as_rchunks_mut < const N : usize > ( & mut self ) -> ( & mut [ T ] , & mut [ [ T ; N ] ] ) {
1206
- assert_ne ! ( N , 0 ) ;
1206
+ assert_ne ! ( N , 0 , "chunks cannot have a size of zero" ) ;
1207
1207
let len = self . len ( ) / N ;
1208
1208
let ( remainder, multiple_of_n) = self . split_at_mut ( self . len ( ) - len * N ) ;
1209
1209
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1244,7 +1244,7 @@ impl<T> [T] {
1244
1244
#[ unstable( feature = "array_chunks" , issue = "74985" ) ]
1245
1245
#[ inline]
1246
1246
pub fn array_chunks_mut < const N : usize > ( & mut self ) -> ArrayChunksMut < ' _ , T , N > {
1247
- assert_ne ! ( N , 0 ) ;
1247
+ assert_ne ! ( N , 0 , "chunks cannot have a size of zero" ) ;
1248
1248
ArrayChunksMut :: new ( self )
1249
1249
}
1250
1250
@@ -1276,7 +1276,7 @@ impl<T> [T] {
1276
1276
#[ unstable( feature = "array_windows" , issue = "75027" ) ]
1277
1277
#[ inline]
1278
1278
pub fn array_windows < const N : usize > ( & self ) -> ArrayWindows < ' _ , T , N > {
1279
- assert_ne ! ( N , 0 ) ;
1279
+ assert_ne ! ( N , 0 , "windows cannot have a size of zero" ) ;
1280
1280
ArrayWindows :: new ( self )
1281
1281
}
1282
1282
0 commit comments