@@ -286,6 +286,7 @@ int_to_from_bytes_impl!(u8, 1);
286
286
int_to_from_bytes_impl ! ( u16 , 2 ) ;
287
287
int_to_from_bytes_impl ! ( u32 , 4 ) ;
288
288
int_to_from_bytes_impl ! ( u64 , 8 ) ;
289
+ int_to_from_bytes_impl ! ( u128 , 16 ) ;
289
290
#[ cfg( target_pointer_width = "64" ) ]
290
291
int_to_from_bytes_impl ! ( usize , 8 ) ;
291
292
#[ cfg( target_pointer_width = "32" ) ]
@@ -295,16 +296,12 @@ int_to_from_bytes_impl!(i8, 1);
295
296
int_to_from_bytes_impl ! ( i16 , 2 ) ;
296
297
int_to_from_bytes_impl ! ( i32 , 4 ) ;
297
298
int_to_from_bytes_impl ! ( i64 , 8 ) ;
299
+ int_to_from_bytes_impl ! ( i128 , 16 ) ;
298
300
#[ cfg( target_pointer_width = "64" ) ]
299
301
int_to_from_bytes_impl ! ( isize , 8 ) ;
300
302
#[ cfg( target_pointer_width = "32" ) ]
301
303
int_to_from_bytes_impl ! ( isize , 4 ) ;
302
304
303
- #[ cfg( has_i128) ]
304
- int_to_from_bytes_impl ! ( u128 , 16 ) ;
305
- #[ cfg( has_i128) ]
306
- int_to_from_bytes_impl ! ( i128 , 16 ) ;
307
-
308
305
float_to_from_bytes_impl ! ( f32 , u32 , 4 ) ;
309
306
float_to_from_bytes_impl ! ( f64 , u64 , 8 ) ;
310
307
@@ -339,14 +336,8 @@ mod tests {
339
336
340
337
#[ test]
341
338
fn convert_between_int_and_bytes ( ) {
342
- check_to_from_bytes ! ( u8 u16 u32 u64 usize ) ;
343
- check_to_from_bytes ! ( i8 i16 i32 i64 isize ) ;
344
- }
345
-
346
- #[ cfg( has_i128) ]
347
- #[ test]
348
- fn convert_between_int_and_bytes_128 ( ) {
349
- check_to_from_bytes ! ( i128 u128 ) ;
339
+ check_to_from_bytes ! ( u8 u16 u32 u64 u128 usize ) ;
340
+ check_to_from_bytes ! ( i8 i16 i32 i64 i128 isize ) ;
350
341
}
351
342
352
343
#[ test]
0 commit comments