@@ -75,7 +75,7 @@ fn canonicalize_signed_zero<T: FloatCore>(x: T) -> T {
75
75
/// s.insert(OrderedFloat(NAN));
76
76
/// assert!(s.contains(&OrderedFloat(NAN)));
77
77
/// ```
78
- #[ derive( Debug , Default , Clone , Copy ) ]
78
+ #[ derive( Default , Clone , Copy ) ]
79
79
#[ repr( transparent) ]
80
80
pub struct OrderedFloat < T > ( pub T ) ;
81
81
@@ -193,6 +193,13 @@ impl<T: FloatCore> Hash for OrderedFloat<T> {
193
193
}
194
194
}
195
195
196
+ impl < T : FloatCore + fmt:: Debug > fmt:: Debug for OrderedFloat < T > {
197
+ #[ inline]
198
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
199
+ self . 0 . fmt ( f)
200
+ }
201
+ }
202
+
196
203
impl < T : FloatCore + fmt:: Display > fmt:: Display for OrderedFloat < T > {
197
204
#[ inline]
198
205
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
@@ -1090,7 +1097,7 @@ impl<T: FloatCore + Num> Num for OrderedFloat<T> {
1090
1097
/// // This will panic:
1091
1098
/// let c = a + b;
1092
1099
/// ```
1093
- #[ derive( PartialOrd , PartialEq , Debug , Default , Clone , Copy ) ]
1100
+ #[ derive( PartialOrd , PartialEq , Default , Clone , Copy ) ]
1094
1101
#[ repr( transparent) ]
1095
1102
pub struct NotNan < T > ( T ) ;
1096
1103
@@ -1177,6 +1184,13 @@ impl<T: FloatCore> Hash for NotNan<T> {
1177
1184
}
1178
1185
}
1179
1186
1187
+ impl < T : FloatCore + fmt:: Debug > fmt:: Debug for NotNan < T > {
1188
+ #[ inline]
1189
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1190
+ self . 0 . fmt ( f)
1191
+ }
1192
+ }
1193
+
1180
1194
impl < T : FloatCore + fmt:: Display > fmt:: Display for NotNan < T > {
1181
1195
#[ inline]
1182
1196
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
0 commit comments