diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs index 182e9b0a00e..f8980b8777e 100644 --- a/src/liballoc/slice.rs +++ b/src/liballoc/slice.rs @@ -613,6 +613,9 @@ impl [T] { /// not divide the length of the slice, then the last chunk will /// not have length `chunk_size`. /// + /// See [`exact_chunks`] for a variant of this iterator that returns chunks + /// of always exactly `chunk_size` elements. + /// /// # Panics /// /// Panics if `chunk_size` is 0. @@ -638,6 +641,10 @@ impl [T] { /// not divide the length of the slice, then the last up to `chunk_size-1` /// elements will be omitted. /// + /// Due to each chunk having exactly `chunk_size` elements, the compiler + /// can often optimize the resulting code better than in the case of + /// [`chunks`]. + /// /// # Panics /// /// Panics if `chunk_size` is 0. @@ -664,6 +671,9 @@ impl [T] { /// not divide the length of the slice, then the last chunk will not /// have length `chunk_size`. /// + /// See [`exact_chunks_mut`] for a variant of this iterator that returns chunks + /// of always exactly `chunk_size` elements. + /// /// # Panics /// /// Panics if `chunk_size` is 0. @@ -693,6 +703,11 @@ impl [T] { /// not divide the length of the slice, then the last up to `chunk_size-1` /// elements will be omitted. /// + /// + /// Due to each chunk having exactly `chunk_size` elements, the compiler + /// can often optimize the resulting code better than in the case of + /// [`chunks_mut`]. + /// /// # Panics /// /// Panics if `chunk_size` is 0.