Skip to content

Commit 20f2290

Browse files
committed
Document how par_chunks lengths may be shorter
1 parent 0c8be8d commit 20f2290

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/slice/mod.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ pub trait ParallelSlice<T: Sync> {
4949
}
5050
}
5151

52-
/// Returns a parallel iterator over all contiguous windows of
53-
/// length `size`. The windows overlap.
52+
/// Returns a parallel iterator over all contiguous windows of length
53+
/// `window_size`. The windows overlap.
5454
///
5555
/// # Examples
5656
///
@@ -66,9 +66,13 @@ pub trait ParallelSlice<T: Sync> {
6666
}
6767
}
6868

69-
/// Returns a parallel iterator over at most `size` elements of
69+
/// Returns a parallel iterator over at most `chunk_size` elements of
7070
/// `self` at a time. The chunks do not overlap.
7171
///
72+
/// If the number of elements in the iterator is not divisible by
73+
/// `chunk_size`, the last chunk may be shorter than `chunk_size`. All
74+
/// other chunks will have that exact length.
75+
///
7276
/// # Examples
7377
///
7478
/// ```
@@ -120,9 +124,13 @@ pub trait ParallelSliceMut<T: Send> {
120124
}
121125
}
122126

123-
/// Returns a parallel iterator over at most `size` elements of
127+
/// Returns a parallel iterator over at most `chunk_size` elements of
124128
/// `self` at a time. The chunks are mutable and do not overlap.
125129
///
130+
/// If the number of elements in the iterator is not divisible by
131+
/// `chunk_size`, the last chunk may be shorter than `chunk_size`. All
132+
/// other chunks will have that exact length.
133+
///
126134
/// # Examples
127135
///
128136
/// ```

0 commit comments

Comments
 (0)