Improve the `filter_map` method doc example readability
@@ -346,21 +346,15 @@ pub trait ParallelIterator: Sized + Send {
/// ```
/// use rayon::prelude::*;
///
- /// let mut par_iter = (0..100).into_par_iter()
+ /// let mut par_iter = (0..10).into_par_iter()
/// .filter_map(|x| {
- /// if x % 2 == 0 {
- /// Some(x * 3)
- /// } else {
- /// None
- /// }
+ /// if x % 2 == 0 { Some(x * 3) }
+ /// else { None }
/// });
///
/// let even_numbers: Vec<_> = par_iter.collect();
///
- /// assert_eq!(even_numbers[0], 0); // 0 * 3
- /// assert_eq!(even_numbers[1], 6); // 2 * 3
- /// assert_eq!(even_numbers[2], 12); // 4 * 3
- /// assert_eq!(even_numbers[3], 18); // 6 * 3
+ /// assert_eq!(&even_numbers[..], &[0, 6, 12, 18, 24]);
/// ```
fn filter_map<P, R>(self, filter_op: P) -> FilterMap<Self, P>
where P: Fn(Self::Item) -> Option<R> + Sync + Send,
