File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -2008,8 +2008,7 @@ pub trait Iterator {
20082008 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
20092009 fn max ( self ) -> Option < Self :: Item > where Self : Sized , Self :: Item : Ord
20102010 {
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)
20132012 }
20142013
20152014 /// Returns the minimum element of an iterator.
@@ -2034,8 +2033,7 @@ pub trait Iterator {
20342033 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
20352034 fn min ( self ) -> Option < Self :: Item > where Self : Sized , Self :: Item : Ord
20362035 {
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)
20392037 }
20402038
20412039 /// Returns the element that gives the maximum value from the
You can’t perform that action at this time.
0 commit comments