@@ -798,16 +798,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
798798 Self : Sized ,
799799 Self : ~const Destruct ,
800800 {
801- #[ cfg( not( bootstrap) ) ]
802- {
803- max_by ( self , other, Ord :: cmp)
804- }
805-
806- #[ cfg( bootstrap) ]
807- match self . cmp ( & other) {
808- Ordering :: Less | Ordering :: Equal => other,
809- Ordering :: Greater => self ,
810- }
801+ max_by ( self , other, Ord :: cmp)
811802 }
812803
813804 /// Compares and returns the minimum of two values.
@@ -828,16 +819,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
828819 Self : Sized ,
829820 Self : ~const Destruct ,
830821 {
831- #[ cfg( not( bootstrap) ) ]
832- {
833- min_by ( self , other, Ord :: cmp)
834- }
835-
836- #[ cfg( bootstrap) ]
837- match self . cmp ( & other) {
838- Ordering :: Less | Ordering :: Equal => self ,
839- Ordering :: Greater => other,
840- }
822+ min_by ( self , other, Ord :: cmp)
841823 }
842824
843825 /// Restrict a value to a certain interval.
@@ -1234,23 +1216,7 @@ where
12341216 F : ~const Destruct ,
12351217 K : ~const Destruct ,
12361218{
1237- cfg_if ! {
1238- if #[ cfg( bootstrap) ] {
1239- const fn imp<T , F : ~const FnMut ( & T ) -> K , K : ~const Ord >(
1240- f: & mut F ,
1241- ( v1, v2) : ( & T , & T ) ,
1242- ) -> Ordering
1243- where
1244- T : ~const Destruct ,
1245- K : ~const Destruct ,
1246- {
1247- f( v1) . cmp( & f( v2) )
1248- }
1249- min_by( v1, v2, ConstFnMutClosure :: new( & mut f, imp) )
1250- } else {
1251- min_by( v1, v2, const |v1, v2| f( v1) . cmp( & f( v2) ) )
1252- }
1253- }
1219+ min_by ( v1, v2, const |v1, v2| f ( v1) . cmp ( & f ( v2) ) )
12541220}
12551221
12561222/// Compares and returns the maximum of two values.
0 commit comments