@@ -55,7 +55,7 @@ impl<T: Float> AsMut<T> for OrderedFloat<T> {
55
55
}
56
56
}
57
57
58
- impl < T : Float + PartialOrd > Ord for OrderedFloat < T > {
58
+ impl < T : Float > Ord for OrderedFloat < T > {
59
59
fn cmp ( & self , other : & OrderedFloat < T > ) -> Ordering {
60
60
match self . partial_cmp ( & other) {
61
61
Some ( ordering) => ordering,
@@ -77,7 +77,7 @@ impl<T: Float + PartialOrd> Ord for OrderedFloat<T> {
77
77
impl < T : Float + PartialEq > PartialEq for OrderedFloat < T > {
78
78
fn eq ( & self , other : & OrderedFloat < T > ) -> bool {
79
79
if self . as_ref ( ) . is_nan ( ) {
80
- if other. as_ref ( ) . is_nan ( ) { true } else { false }
80
+ other. as_ref ( ) . is_nan ( )
81
81
} else if other. as_ref ( ) . is_nan ( ) {
82
82
false
83
83
} else {
@@ -176,7 +176,7 @@ impl<T: Float> AsRef<T> for NotNaN<T> {
176
176
}
177
177
}
178
178
179
- impl < T : Float + PartialOrd > Ord for NotNaN < T > {
179
+ impl < T : Float > Ord for NotNaN < T > {
180
180
fn cmp ( & self , other : & NotNaN < T > ) -> Ordering {
181
181
match self . partial_cmp ( & other) {
182
182
Some ( ord) => ord,
@@ -522,7 +522,7 @@ pub struct FloatIsNaN;
522
522
523
523
impl Error for FloatIsNaN {
524
524
fn description ( & self ) -> & str {
525
- return "NotNaN constructed with NaN" ;
525
+ "NotNaN constructed with NaN"
526
526
}
527
527
}
528
528
0 commit comments