@@ -2198,7 +2198,12 @@ pub trait ParallelIterator: Sized + Send {
21982198 Intersperse :: new ( self , element)
21992199 }
22002200
2201- /// Creates an iterator that yields the first `n` elements.
2201+ /// Creates an iterator that yields `n` elements from *anywhere* in the original iterator.
2202+ ///
2203+ /// This is similar to [`IndexedParallelIterator::take`] without being
2204+ /// constrained to the "first" `n` of the original iterator order. The
2205+ /// taken items will still maintain their relative order where that is
2206+ /// visible in `collect`, `reduce`, and similar outputs.
22022207 ///
22032208 /// # Examples
22042209 ///
@@ -2212,12 +2217,18 @@ pub trait ParallelIterator: Sized + Send {
22122217 /// .collect();
22132218 ///
22142219 /// assert_eq!(result.len(), 5);
2220+ /// assert!(result.windows(2).all(|w| w[0] < w[1]));
22152221 /// ```
22162222 fn take_any ( self , n : usize ) -> TakeAny < Self > {
22172223 TakeAny :: new ( self , n)
22182224 }
22192225
2220- /// Creates an iterator that skips the first `n` elements.
2226+ /// Creates an iterator that skips `n` elements from *anywhere* in the original iterator.
2227+ ///
2228+ /// This is similar to [`IndexedParallelIterator::skip`] without being
2229+ /// constrained to the "first" `n` of the original iterator order. The
2230+ /// remaining items will still maintain their relative order where that is
2231+ /// visible in `collect`, `reduce`, and similar outputs.
22212232 ///
22222233 /// # Examples
22232234 ///
@@ -2231,6 +2242,7 @@ pub trait ParallelIterator: Sized + Send {
22312242 /// .collect();
22322243 ///
22332244 /// assert_eq!(result.len(), 45);
2245+ /// assert!(result.windows(2).all(|w| w[0] < w[1]));
22342246 /// ```
22352247 fn skip_any ( self , n : usize ) -> SkipAny < Self > {
22362248 SkipAny :: new ( self , n)
0 commit comments