@@ -798,16 +798,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
798
798
Self : Sized ,
799
799
Self : ~const Destruct ,
800
800
{
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)
811
802
}
812
803
813
804
/// Compares and returns the minimum of two values.
@@ -828,16 +819,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
828
819
Self : Sized ,
829
820
Self : ~const Destruct ,
830
821
{
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)
841
823
}
842
824
843
825
/// Restrict a value to a certain interval.
@@ -1234,23 +1216,7 @@ where
1234
1216
F : ~const Destruct ,
1235
1217
K : ~const Destruct ,
1236
1218
{
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) ) )
1254
1220
}
1255
1221
1256
1222
/// Compares and returns the maximum of two values.
0 commit comments