@@ -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
@@ -1017,7 +1017,7 @@ impl<T> [T] {
10171017 #[ inline]
10181018 #[ must_use]
10191019 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" ) ;
10211021 let len = self . len ( ) / N ;
10221022 let ( multiple_of_n, remainder) = self . split_at ( len * N ) ;
10231023 // SAFETY: We already panicked for zero, and ensured by construction
@@ -1048,7 +1048,7 @@ impl<T> [T] {
10481048 #[ inline]
10491049 #[ must_use]
10501050 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" ) ;
10521052 let len = self . len ( ) / N ;
10531053 let ( remainder, multiple_of_n) = self . split_at ( self . len ( ) - len * N ) ;
10541054 // SAFETY: We already panicked for zero, and ensured by construction
@@ -1087,7 +1087,7 @@ impl<T> [T] {
10871087 #[ unstable( feature = "array_chunks" , issue = "74985" ) ]
10881088 #[ inline]
10891089 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" ) ;
10911091 ArrayChunks :: new ( self )
10921092 }
10931093
@@ -1166,7 +1166,7 @@ impl<T> [T] {
11661166 #[ inline]
11671167 #[ must_use]
11681168 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" ) ;
11701170 let len = self . len ( ) / N ;
11711171 let ( multiple_of_n, remainder) = self . split_at_mut ( len * N ) ;
11721172 // SAFETY: We already panicked for zero, and ensured by construction
@@ -1203,7 +1203,7 @@ impl<T> [T] {
12031203 #[ inline]
12041204 #[ must_use]
12051205 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" ) ;
12071207 let len = self . len ( ) / N ;
12081208 let ( remainder, multiple_of_n) = self . split_at_mut ( self . len ( ) - len * N ) ;
12091209 // SAFETY: We already panicked for zero, and ensured by construction
@@ -1244,7 +1244,7 @@ impl<T> [T] {
12441244 #[ unstable( feature = "array_chunks" , issue = "74985" ) ]
12451245 #[ inline]
12461246 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" ) ;
12481248 ArrayChunksMut :: new ( self )
12491249 }
12501250
@@ -1276,7 +1276,7 @@ impl<T> [T] {
12761276 #[ unstable( feature = "array_windows" , issue = "75027" ) ]
12771277 #[ inline]
12781278 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" ) ;
12801280 ArrayWindows :: new ( self )
12811281 }
12821282
0 commit comments