@@ -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
@@ -1006,7 +1006,7 @@ impl<T> [T] {
1006
1006
#[ inline]
1007
1007
#[ must_use]
1008
1008
pub fn as_chunks < const N : usize > ( & self ) -> ( & [ [ T ; N ] ] , & [ T ] ) {
1009
- assert_ne ! ( N , 0 ) ;
1009
+ assert_ne ! ( N , 0 , "chunks cannot have a size of zero" ) ;
1010
1010
let len = self . len ( ) / N ;
1011
1011
let ( multiple_of_n, remainder) = self . split_at ( len * N ) ;
1012
1012
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1037,7 +1037,7 @@ impl<T> [T] {
1037
1037
#[ inline]
1038
1038
#[ must_use]
1039
1039
pub fn as_rchunks < const N : usize > ( & self ) -> ( & [ T ] , & [ [ T ; N ] ] ) {
1040
- assert_ne ! ( N , 0 ) ;
1040
+ assert_ne ! ( N , 0 , "chunks cannot have a size of zero" ) ;
1041
1041
let len = self . len ( ) / N ;
1042
1042
let ( remainder, multiple_of_n) = self . split_at ( self . len ( ) - len * N ) ;
1043
1043
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1076,7 +1076,7 @@ impl<T> [T] {
1076
1076
#[ unstable( feature = "array_chunks" , issue = "74985" ) ]
1077
1077
#[ inline]
1078
1078
pub fn array_chunks < const N : usize > ( & self ) -> ArrayChunks < ' _ , T , N > {
1079
- assert_ne ! ( N , 0 ) ;
1079
+ assert_ne ! ( N , 0 , "chunks cannot have a size of zero" ) ;
1080
1080
ArrayChunks :: new ( self )
1081
1081
}
1082
1082
@@ -1155,7 +1155,7 @@ impl<T> [T] {
1155
1155
#[ inline]
1156
1156
#[ must_use]
1157
1157
pub fn as_chunks_mut < const N : usize > ( & mut self ) -> ( & mut [ [ T ; N ] ] , & mut [ T ] ) {
1158
- assert_ne ! ( N , 0 ) ;
1158
+ assert_ne ! ( N , 0 , "chunks cannot have a size of zero" ) ;
1159
1159
let len = self . len ( ) / N ;
1160
1160
let ( multiple_of_n, remainder) = self . split_at_mut ( len * N ) ;
1161
1161
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1192,7 +1192,7 @@ impl<T> [T] {
1192
1192
#[ inline]
1193
1193
#[ must_use]
1194
1194
pub fn as_rchunks_mut < const N : usize > ( & mut self ) -> ( & mut [ T ] , & mut [ [ T ; N ] ] ) {
1195
- assert_ne ! ( N , 0 ) ;
1195
+ assert_ne ! ( N , 0 , "chunks cannot have a size of zero" ) ;
1196
1196
let len = self . len ( ) / N ;
1197
1197
let ( remainder, multiple_of_n) = self . split_at_mut ( self . len ( ) - len * N ) ;
1198
1198
// SAFETY: We already panicked for zero, and ensured by construction
@@ -1233,7 +1233,7 @@ impl<T> [T] {
1233
1233
#[ unstable( feature = "array_chunks" , issue = "74985" ) ]
1234
1234
#[ inline]
1235
1235
pub fn array_chunks_mut < const N : usize > ( & mut self ) -> ArrayChunksMut < ' _ , T , N > {
1236
- assert_ne ! ( N , 0 ) ;
1236
+ assert_ne ! ( N , 0 , "chunks cannot have a size of zero" ) ;
1237
1237
ArrayChunksMut :: new ( self )
1238
1238
}
1239
1239
@@ -1265,7 +1265,7 @@ impl<T> [T] {
1265
1265
#[ unstable( feature = "array_windows" , issue = "75027" ) ]
1266
1266
#[ inline]
1267
1267
pub fn array_windows < const N : usize > ( & self ) -> ArrayWindows < ' _ , T , N > {
1268
- assert_ne ! ( N , 0 ) ;
1268
+ assert_ne ! ( N , 0 , "windows cannot have a size of zero" ) ;
1269
1269
ArrayWindows :: new ( self )
1270
1270
}
1271
1271
0 commit comments