aboutsummaryrefslogtreecommitdiff
path: root/src/io.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/io.rs')
-rw-r--r--src/io.rs21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/io.rs b/src/io.rs
index 74cf9dd..bc49a1c 100644
--- a/src/io.rs
+++ b/src/io.rs
@@ -370,7 +370,7 @@ pub trait ReadBytesExt: io::Read {
/// ]);
/// assert_eq!(16947640962301618749969007319746179, rdr.read_u128::<BigEndian>().unwrap());
/// ```
- #[cfg(feature = "i128")]
+ #[cfg(byteorder_i128)]
#[inline]
fn read_u128<T: ByteOrder>(&mut self) -> Result<u128> {
let mut buf = [0; 16];
@@ -391,14 +391,13 @@ pub trait ReadBytesExt: io::Read {
/// Read a signed 128 bit big-endian integer from a `Read`:
///
/// ```rust
- /// #![feature(i128_type)]
/// use std::io::Cursor;
/// use byteorder::{BigEndian, ReadBytesExt};
///
/// let mut rdr = Cursor::new(vec![0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
/// assert_eq!(i128::min_value(), rdr.read_i128::<BigEndian>().unwrap());
/// ```
- #[cfg(feature = "i128")]
+ #[cfg(byteorder_i128)]
#[inline]
fn read_i128<T: ByteOrder>(&mut self) -> Result<i128> {
let mut buf = [0; 16];
@@ -457,7 +456,7 @@ pub trait ReadBytesExt: io::Read {
}
/// Reads an unsigned n-bytes integer from the underlying reader.
- #[cfg(feature = "i128")]
+ #[cfg(byteorder_i128)]
#[inline]
fn read_uint128<T: ByteOrder>(&mut self, nbytes: usize) -> Result<u128> {
let mut buf = [0; 16];
@@ -466,7 +465,7 @@ pub trait ReadBytesExt: io::Read {
}
/// Reads a signed n-bytes integer from the underlying reader.
- #[cfg(feature = "i128")]
+ #[cfg(byteorder_i128)]
#[inline]
fn read_int128<T: ByteOrder>(&mut self, nbytes: usize) -> Result<i128> {
let mut buf = [0; 16];
@@ -672,7 +671,7 @@ pub trait ReadBytesExt: io::Read {
/// rdr.read_u128_into::<BigEndian>(&mut dst).unwrap();
/// assert_eq!([517, 768], dst);
/// ```
- #[cfg(feature = "i128")]
+ #[cfg(byteorder_i128)]
#[inline]
fn read_u128_into<T: ByteOrder>(
&mut self,
@@ -822,7 +821,7 @@ pub trait ReadBytesExt: io::Read {
/// rdr.read_i128_into::<BigEndian>(&mut dst).unwrap();
/// assert_eq!([517, 768], dst);
/// ```
- #[cfg(feature = "i128")]
+ #[cfg(byteorder_i128)]
#[inline]
fn read_i128_into<T: ByteOrder>(
&mut self,
@@ -1373,7 +1372,7 @@ pub trait WriteBytesExt: io::Write {
}
/// Writes an unsigned 128 bit integer to the underlying writer.
- #[cfg(feature = "i128")]
+ #[cfg(byteorder_i128)]
#[inline]
fn write_u128<T: ByteOrder>(&mut self, n: u128) -> Result<()> {
let mut buf = [0; 16];
@@ -1382,7 +1381,7 @@ pub trait WriteBytesExt: io::Write {
}
/// Writes a signed 128 bit integer to the underlying writer.
- #[cfg(feature = "i128")]
+ #[cfg(byteorder_i128)]
#[inline]
fn write_i128<T: ByteOrder>(&mut self, n: i128) -> Result<()> {
let mut buf = [0; 16];
@@ -1466,7 +1465,7 @@ pub trait WriteBytesExt: io::Write {
///
/// If the given integer is not representable in the given number of bytes,
/// this method panics. If `nbytes > 16`, this method panics.
- #[cfg(feature = "i128")]
+ #[cfg(byteorder_i128)]
#[inline]
fn write_uint128<T: ByteOrder>(
&mut self,
@@ -1482,7 +1481,7 @@ pub trait WriteBytesExt: io::Write {
///
/// If the given integer is not representable in the given number of bytes,
/// this method panics. If `nbytes > 16`, this method panics.
- #[cfg(feature = "i128")]
+ #[cfg(byteorder_i128)]
#[inline]
fn write_int128<T: ByteOrder>(
&mut self,