Skip to content

Commit 447e05d

Browse files
committed
has_i128 is always assumed now
1 parent e566d77 commit 447e05d

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

src/ops/bytes.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ int_to_from_bytes_impl!(u8, 1);
286286
int_to_from_bytes_impl!(u16, 2);
287287
int_to_from_bytes_impl!(u32, 4);
288288
int_to_from_bytes_impl!(u64, 8);
289+
int_to_from_bytes_impl!(u128, 16);
289290
#[cfg(target_pointer_width = "64")]
290291
int_to_from_bytes_impl!(usize, 8);
291292
#[cfg(target_pointer_width = "32")]
@@ -295,16 +296,12 @@ int_to_from_bytes_impl!(i8, 1);
295296
int_to_from_bytes_impl!(i16, 2);
296297
int_to_from_bytes_impl!(i32, 4);
297298
int_to_from_bytes_impl!(i64, 8);
299+
int_to_from_bytes_impl!(i128, 16);
298300
#[cfg(target_pointer_width = "64")]
299301
int_to_from_bytes_impl!(isize, 8);
300302
#[cfg(target_pointer_width = "32")]
301303
int_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-
308305
float_to_from_bytes_impl!(f32, u32, 4);
309306
float_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

Comments
 (0)