@@ -1570,11 +1570,6 @@ pub fn min<T: Ord>(v1: T, v2: T) -> T {
1570
1570
///
1571
1571
/// let result = cmp::min_by(1, -1, abs_cmp);
1572
1572
/// assert_eq!(result, 1);
1573
- ///
1574
- /// let rhs_abs_cmp = |x: &i32, y: &i32| x.cmp(&y.abs());
1575
- ///
1576
- /// let result = cmp::min_by(-2, 1, rhs_abs_cmp);
1577
- /// assert_eq!(result, -2);
1578
1573
/// ```
1579
1574
#[ inline]
1580
1575
#[ must_use]
@@ -1670,11 +1665,6 @@ pub fn max<T: Ord>(v1: T, v2: T) -> T {
1670
1665
///
1671
1666
/// let result = cmp::max_by(1, -1, abs_cmp);
1672
1667
/// assert_eq!(result, -1);
1673
- ///
1674
- /// let rhs_abs_cmp = |x: &i32, y: &i32| x.cmp(&y.abs());
1675
- ///
1676
- /// let result = cmp::max_by(-2, 1, rhs_abs_cmp);
1677
- /// assert_eq!(result, 1);
1678
1668
/// ```
1679
1669
#[ inline]
1680
1670
#[ must_use]
@@ -1774,10 +1764,6 @@ where
1774
1764
/// assert_eq!(cmp::minmax_by(-1, 2, abs_cmp), [-1, 2]);
1775
1765
/// assert_eq!(cmp::minmax_by(-2, 2, abs_cmp), [-2, 2]);
1776
1766
///
1777
- /// let rhs_abs_cmp = |x: &i32, y: &i32| x.cmp(&y.abs());
1778
- ///
1779
- /// assert_eq!(cmp::minmax_by(-2, 1, rhs_abs_cmp), [-2, 1]);
1780
- ///
1781
1767
/// // You can destructure the result using array patterns
1782
1768
/// let [min, max] = cmp::minmax_by(-42, 17, abs_cmp);
1783
1769
/// assert_eq!(min, 17);
0 commit comments