@@ -1120,6 +1120,9 @@ impl<T> [T] {
1120
1120
/// `chunk_size` elements, and [`rchunks`] for the same iterator but starting at the end of the
1121
1121
/// slice.
1122
1122
///
1123
+ /// If your `chunk_size` is a constant, consider using [`as_chunks`] instead, which will
1124
+ /// give references to arrays of exactly that length, rather than slices.
1125
+ ///
1123
1126
/// # Panics
1124
1127
///
1125
1128
/// Panics if `chunk_size` is zero.
@@ -1137,6 +1140,7 @@ impl<T> [T] {
1137
1140
///
1138
1141
/// [`chunks_exact`]: slice::chunks_exact
1139
1142
/// [`rchunks`]: slice::rchunks
1143
+ /// [`as_chunks`]: slice::as_chunks
1140
1144
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1141
1145
#[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
1142
1146
#[ inline]
@@ -1156,6 +1160,9 @@ impl<T> [T] {
1156
1160
/// exactly `chunk_size` elements, and [`rchunks_mut`] for the same iterator but starting at
1157
1161
/// the end of the slice.
1158
1162
///
1163
+ /// If your `chunk_size` is a constant, consider using [`as_chunks_mut`] instead, which will
1164
+ /// give references to arrays of exactly that length, rather than slices.
1165
+ ///
1159
1166
/// # Panics
1160
1167
///
1161
1168
/// Panics if `chunk_size` is zero.
@@ -1177,6 +1184,7 @@ impl<T> [T] {
1177
1184
///
1178
1185
/// [`chunks_exact_mut`]: slice::chunks_exact_mut
1179
1186
/// [`rchunks_mut`]: slice::rchunks_mut
1187
+ /// [`as_chunks_mut`]: slice::as_chunks_mut
1180
1188
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1181
1189
#[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
1182
1190
#[ inline]
@@ -1199,6 +1207,9 @@ impl<T> [T] {
1199
1207
/// See [`chunks`] for a variant of this iterator that also returns the remainder as a smaller
1200
1208
/// chunk, and [`rchunks_exact`] for the same iterator but starting at the end of the slice.
1201
1209
///
1210
+ /// If your `chunk_size` is a constant, consider using [`as_chunks`] instead, which will
1211
+ /// give references to arrays of exactly that length, rather than slices.
1212
+ ///
1202
1213
/// # Panics
1203
1214
///
1204
1215
/// Panics if `chunk_size` is zero.
@@ -1216,6 +1227,7 @@ impl<T> [T] {
1216
1227
///
1217
1228
/// [`chunks`]: slice::chunks
1218
1229
/// [`rchunks_exact`]: slice::rchunks_exact
1230
+ /// [`as_chunks`]: slice::chunks
1219
1231
#[ stable( feature = "chunks_exact" , since = "1.31.0" ) ]
1220
1232
#[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
1221
1233
#[ inline]
@@ -1239,6 +1251,9 @@ impl<T> [T] {
1239
1251
/// smaller chunk, and [`rchunks_exact_mut`] for the same iterator but starting at the end of
1240
1252
/// the slice.
1241
1253
///
1254
+ /// If your `chunk_size` is a constant, consider using [`as_chunks_mut`] instead, which will
1255
+ /// give references to arrays of exactly that length, rather than slices.
1256
+ ///
1242
1257
/// # Panics
1243
1258
///
1244
1259
/// Panics if `chunk_size` is zero.
@@ -1260,6 +1275,7 @@ impl<T> [T] {
1260
1275
///
1261
1276
/// [`chunks_mut`]: slice::chunks_mut
1262
1277
/// [`rchunks_exact_mut`]: slice::rchunks_exact_mut
1278
+ /// [`as_chunks_mut`]: slice::as_chunks_mut
1263
1279
#[ stable( feature = "chunks_exact" , since = "1.31.0" ) ]
1264
1280
#[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
1265
1281
#[ inline]
@@ -1707,6 +1723,9 @@ impl<T> [T] {
1707
1723
/// `chunk_size` elements, and [`chunks`] for the same iterator but starting at the beginning
1708
1724
/// of the slice.
1709
1725
///
1726
+ /// If your `chunk_size` is a constant, consider using [`as_rchunks`] instead, which will
1727
+ /// give references to arrays of exactly that length, rather than slices.
1728
+ ///
1710
1729
/// # Panics
1711
1730
///
1712
1731
/// Panics if `chunk_size` is zero.
@@ -1724,6 +1743,7 @@ impl<T> [T] {
1724
1743
///
1725
1744
/// [`rchunks_exact`]: slice::rchunks_exact
1726
1745
/// [`chunks`]: slice::chunks
1746
+ /// [`as_rchunks`]: slice::as_rchunks
1727
1747
#[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1728
1748
#[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
1729
1749
#[ inline]
@@ -1743,6 +1763,9 @@ impl<T> [T] {
1743
1763
/// exactly `chunk_size` elements, and [`chunks_mut`] for the same iterator but starting at the
1744
1764
/// beginning of the slice.
1745
1765
///
1766
+ /// If your `chunk_size` is a constant, consider using [`as_rchunks_mut`] instead, which will
1767
+ /// give references to arrays of exactly that length, rather than slices.
1768
+ ///
1746
1769
/// # Panics
1747
1770
///
1748
1771
/// Panics if `chunk_size` is zero.
@@ -1764,6 +1787,7 @@ impl<T> [T] {
1764
1787
///
1765
1788
/// [`rchunks_exact_mut`]: slice::rchunks_exact_mut
1766
1789
/// [`chunks_mut`]: slice::chunks_mut
1790
+ /// [`as_rchunks_mut`]: slice::as_rchunks_mut
1767
1791
#[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1768
1792
#[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
1769
1793
#[ inline]
@@ -1787,6 +1811,9 @@ impl<T> [T] {
1787
1811
/// chunk, and [`chunks_exact`] for the same iterator but starting at the beginning of the
1788
1812
/// slice.
1789
1813
///
1814
+ /// If your `chunk_size` is a constant, consider using [`as_rchunks`] instead, which will
1815
+ /// give references to arrays of exactly that length, rather than slices.
1816
+ ///
1790
1817
/// # Panics
1791
1818
///
1792
1819
/// Panics if `chunk_size` is zero.
@@ -1805,6 +1832,7 @@ impl<T> [T] {
1805
1832
/// [`chunks`]: slice::chunks
1806
1833
/// [`rchunks`]: slice::rchunks
1807
1834
/// [`chunks_exact`]: slice::chunks_exact
1835
+ /// [`as_rchunks`]: slice::as_rchunks
1808
1836
#[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1809
1837
#[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
1810
1838
#[ inline]
@@ -1828,6 +1856,9 @@ impl<T> [T] {
1828
1856
/// smaller chunk, and [`chunks_exact_mut`] for the same iterator but starting at the beginning
1829
1857
/// of the slice.
1830
1858
///
1859
+ /// If your `chunk_size` is a constant, consider using [`as_rchunks_mut`] instead, which will
1860
+ /// give references to arrays of exactly that length, rather than slices.
1861
+ ///
1831
1862
/// # Panics
1832
1863
///
1833
1864
/// Panics if `chunk_size` is zero.
@@ -1850,6 +1881,7 @@ impl<T> [T] {
1850
1881
/// [`chunks_mut`]: slice::chunks_mut
1851
1882
/// [`rchunks_mut`]: slice::rchunks_mut
1852
1883
/// [`chunks_exact_mut`]: slice::chunks_exact_mut
1884
+ /// [`as_rchunks_mut`]: slice::as_rchunks_mut
1853
1885
#[ stable( feature = "rchunks" , since = "1.31.0" ) ]
1854
1886
#[ rustc_const_unstable( feature = "const_slice_make_iter" , issue = "137737" ) ]
1855
1887
#[ inline]
0 commit comments