@@ -893,7 +893,7 @@ impl<T> [T] {
893893 #[ stable( feature = "chunks_exact" , since = "1.31.0" ) ]
894894 #[ inline]
895895 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" ) ;
897897 ChunksExact :: new ( self , chunk_size)
898898 }
899899
@@ -935,7 +935,7 @@ impl<T> [T] {
935935 #[ stable( feature = "chunks_exact" , since = "1.31.0" ) ]
936936 #[ inline]
937937 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" ) ;
939939 ChunksExactMut :: new ( self , chunk_size)
940940 }
941941
@@ -1006,7 +1006,7 @@ impl<T> [T] {
10061006 #[ inline]
10071007 #[ must_use]
10081008 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" ) ;
10101010 let len = self . len ( ) / N ;
10111011 let ( multiple_of_n, remainder) = self . split_at ( len * N ) ;
10121012 // SAFETY: We already panicked for zero, and ensured by construction
@@ -1037,7 +1037,7 @@ impl<T> [T] {
10371037 #[ inline]
10381038 #[ must_use]
10391039 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" ) ;
10411041 let len = self . len ( ) / N ;
10421042 let ( remainder, multiple_of_n) = self . split_at ( self . len ( ) - len * N ) ;
10431043 // SAFETY: We already panicked for zero, and ensured by construction
@@ -1076,7 +1076,7 @@ impl<T> [T] {
10761076 #[ unstable( feature = "array_chunks" , issue = "74985" ) ]
10771077 #[ inline]
10781078 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" ) ;
10801080 ArrayChunks :: new ( self )
10811081 }
10821082
@@ -1155,7 +1155,7 @@ impl<T> [T] {
11551155 #[ inline]
11561156 #[ must_use]
11571157 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" ) ;
11591159 let len = self . len ( ) / N ;
11601160 let ( multiple_of_n, remainder) = self . split_at_mut ( len * N ) ;
11611161 // SAFETY: We already panicked for zero, and ensured by construction
@@ -1192,7 +1192,7 @@ impl<T> [T] {
11921192 #[ inline]
11931193 #[ must_use]
11941194 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" ) ;
11961196 let len = self . len ( ) / N ;
11971197 let ( remainder, multiple_of_n) = self . split_at_mut ( self . len ( ) - len * N ) ;
11981198 // SAFETY: We already panicked for zero, and ensured by construction
@@ -1233,7 +1233,7 @@ impl<T> [T] {
12331233 #[ unstable( feature = "array_chunks" , issue = "74985" ) ]
12341234 #[ inline]
12351235 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" ) ;
12371237 ArrayChunksMut :: new ( self )
12381238 }
12391239
@@ -1265,7 +1265,7 @@ impl<T> [T] {
12651265 #[ unstable( feature = "array_windows" , issue = "75027" ) ]
12661266 #[ inline]
12671267 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" ) ;
12691269 ArrayWindows :: new ( self )
12701270 }
12711271
0 commit comments