File tree 1 file changed +2
-4
lines changed
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -2008,8 +2008,7 @@ pub trait Iterator {
2008
2008
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2009
2009
fn max ( self ) -> Option < Self :: Item > where Self : Sized , Self :: Item : Ord
2010
2010
{
2011
- // switch to y even if it is only equal, to preserve stability.
2012
- select_fold1 ( self , |x, y| x <= y)
2011
+ self . max_by ( Ord :: cmp)
2013
2012
}
2014
2013
2015
2014
/// Returns the minimum element of an iterator.
@@ -2034,8 +2033,7 @@ pub trait Iterator {
2034
2033
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2035
2034
fn min ( self ) -> Option < Self :: Item > where Self : Sized , Self :: Item : Ord
2036
2035
{
2037
- // only switch to y if it is strictly smaller, to preserve stability.
2038
- select_fold1 ( self , |x, y| x > y)
2036
+ self . min_by ( Ord :: cmp)
2039
2037
}
2040
2038
2041
2039
/// Returns the element that gives the maximum value from the
You can’t perform that action at this time.
0 commit comments