Add an example to the `max_by` method doc
@@ -771,9 +771,13 @@ pub trait ParallelIterator: Sized + Send {
/// specified, so if the comparison function is not associative, then
/// the results are not deterministic.
///
+ /// # Examples
+ ///
/// ```
/// use rayon::prelude::*;
+ ///
/// let a = [-3_i32, 77, 53, 240, -1];
+ ///
/// assert_eq!(a.par_iter().max_by(|x, y| x.abs().cmp(&y.abs())), Some(&240));
/// ```
fn max_by<F>(self, f: F) -> Option<Self::Item>
