@@ -245,29 +245,21 @@ fn fmt_any_hex<F: Float>(x: &F, f: &mut fmt::Formatter<'_>) -> fmt::Result {
245
245
write ! ( f, "0x{leading}{sig:0mwidth$x}p{exponent:+}" )
246
246
}
247
247
248
- #[ cfg( f16_enabled) ]
249
- impl fmt:: LowerHex for Hexf < f16 > {
248
+ impl < F : Float > fmt:: LowerHex for Hexf < F > {
250
249
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
251
250
fmt_any_hex ( & self . 0 , f)
252
251
}
253
252
}
254
253
255
- impl fmt:: LowerHex for Hexf < f32 > {
254
+ impl < F : Float > fmt:: LowerHex for Hexf < ( F , F ) > {
256
255
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
257
- fmt_any_hex ( & self . 0 , f)
258
- }
259
- }
260
-
261
- impl fmt:: LowerHex for Hexf < f64 > {
262
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
263
- fmt_any_hex ( & self . 0 , f)
256
+ write ! ( f, "({:x}, {:x})" , Hexf ( self . 0.0 ) , Hexf ( self . 0.1 ) )
264
257
}
265
258
}
266
259
267
- #[ cfg( f128_enabled) ]
268
- impl fmt:: LowerHex for Hexf < f128 > {
260
+ impl < F : Float > fmt:: LowerHex for Hexf < ( F , i32 ) > {
269
261
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
270
- fmt_any_hex ( & self . 0 , f )
262
+ write ! ( f , "({:x}, {:x})" , Hexf ( self . 0.0 ) , Hexf ( self . 0.1 ) )
271
263
}
272
264
}
273
265
@@ -277,18 +269,6 @@ impl fmt::LowerHex for Hexf<i32> {
277
269
}
278
270
}
279
271
280
- impl < T1 , T2 > fmt:: LowerHex for Hexf < ( T1 , T2 ) >
281
- where
282
- T1 : Copy ,
283
- T2 : Copy ,
284
- Hexf < T1 > : fmt:: LowerHex ,
285
- Hexf < T2 > : fmt:: LowerHex ,
286
- {
287
- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
288
- write ! ( f, "({:x}, {:x})" , Hexf ( self . 0.0 ) , Hexf ( self . 0.1 ) )
289
- }
290
- }
291
-
292
272
impl < T > fmt:: Debug for Hexf < T >
293
273
where
294
274
Hexf < T > : fmt:: LowerHex ,
0 commit comments