@@ -286,6 +286,7 @@ int_to_from_bytes_impl!(u8, 1);
286286int_to_from_bytes_impl ! ( u16 , 2 ) ;
287287int_to_from_bytes_impl ! ( u32 , 4 ) ;
288288int_to_from_bytes_impl ! ( u64 , 8 ) ;
289+ int_to_from_bytes_impl ! ( u128 , 16 ) ;
289290#[ cfg( target_pointer_width = "64" ) ]
290291int_to_from_bytes_impl ! ( usize , 8 ) ;
291292#[ cfg( target_pointer_width = "32" ) ]
@@ -295,16 +296,12 @@ int_to_from_bytes_impl!(i8, 1);
295296int_to_from_bytes_impl ! ( i16 , 2 ) ;
296297int_to_from_bytes_impl ! ( i32 , 4 ) ;
297298int_to_from_bytes_impl ! ( i64 , 8 ) ;
299+ int_to_from_bytes_impl ! ( i128 , 16 ) ;
298300#[ cfg( target_pointer_width = "64" ) ]
299301int_to_from_bytes_impl ! ( isize , 8 ) ;
300302#[ cfg( target_pointer_width = "32" ) ]
301303int_to_from_bytes_impl ! ( isize , 4 ) ;
302304
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-
308305float_to_from_bytes_impl ! ( f32 , u32 , 4 ) ;
309306float_to_from_bytes_impl ! ( f64 , u64 , 8 ) ;
310307
@@ -339,14 +336,8 @@ mod tests {
339336
340337 #[ test]
341338 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 ) ;
350341 }
351342
352343 #[ test]
0 commit comments