@@ -172,7 +172,7 @@ pub trait FromBytes: Sized {
172
172
}
173
173
174
174
macro_rules! float_to_from_bytes_impl {
175
- ( $T: ty, $I : ty , $ L: expr) => {
175
+ ( $T: ty, $L: expr) => {
176
176
#[ cfg( has_float_to_from_bytes) ]
177
177
impl ToBytes for $T {
178
178
type Bytes = [ u8 ; $L] ;
@@ -219,17 +219,17 @@ macro_rules! float_to_from_bytes_impl {
219
219
220
220
#[ inline]
221
221
fn to_be_bytes( & self ) -> Self :: Bytes {
222
- <$I as ToBytes > :: to_be_bytes( & self . to_bits( ) )
222
+ ToBytes :: to_be_bytes( & self . to_bits( ) )
223
223
}
224
224
225
225
#[ inline]
226
226
fn to_le_bytes( & self ) -> Self :: Bytes {
227
- <$I as ToBytes > :: to_le_bytes( & self . to_bits( ) )
227
+ ToBytes :: to_le_bytes( & self . to_bits( ) )
228
228
}
229
229
230
230
#[ inline]
231
231
fn to_ne_bytes( & self ) -> Self :: Bytes {
232
- <$I as ToBytes > :: to_ne_bytes( & self . to_bits( ) )
232
+ ToBytes :: to_ne_bytes( & self . to_bits( ) )
233
233
}
234
234
}
235
235
@@ -239,17 +239,17 @@ macro_rules! float_to_from_bytes_impl {
239
239
240
240
#[ inline]
241
241
fn from_be_bytes( bytes: & Self :: Bytes ) -> Self {
242
- Self :: from_bits( <$I as FromBytes > :: from_be_bytes( & bytes) )
242
+ Self :: from_bits( FromBytes :: from_be_bytes( bytes) )
243
243
}
244
244
245
245
#[ inline]
246
246
fn from_le_bytes( bytes: & Self :: Bytes ) -> Self {
247
- Self :: from_bits( <$I as FromBytes > :: from_le_bytes( & bytes) )
247
+ Self :: from_bits( FromBytes :: from_le_bytes( bytes) )
248
248
}
249
249
250
250
#[ inline]
251
251
fn from_ne_bytes( bytes: & Self :: Bytes ) -> Self {
252
- Self :: from_bits( <$I as FromBytes > :: from_ne_bytes( & bytes) )
252
+ Self :: from_bits( FromBytes :: from_ne_bytes( bytes) )
253
253
}
254
254
}
255
255
} ;
@@ -359,8 +359,8 @@ int_to_from_bytes_impl!(isize, 8);
359
359
#[ cfg( target_pointer_width = "32" ) ]
360
360
int_to_from_bytes_impl ! ( isize , 4 ) ;
361
361
362
- float_to_from_bytes_impl ! ( f32 , u32 , 4 ) ;
363
- float_to_from_bytes_impl ! ( f64 , u64 , 8 ) ;
362
+ float_to_from_bytes_impl ! ( f32 , 4 ) ;
363
+ float_to_from_bytes_impl ! ( f64 , 8 ) ;
364
364
365
365
#[ cfg( test) ]
366
366
mod tests {
0 commit comments