mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-23 00:00:13 +02:00
Remove i128 feature (#276)
This commit is contained in:
+1
-7
@@ -19,16 +19,10 @@ edition = "2018"
|
|||||||
|
|
||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
|
||||||
features = ["i128"]
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
byteorder = "1.1.0"
|
byteorder = "1.3"
|
||||||
serde = { version = "1.0", optional = true }
|
serde = { version = "1.0", optional = true }
|
||||||
either = { version = "1.5", default-features = false, optional = true }
|
either = { version = "1.5", default-features = false, optional = true }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
serde_test = "1.0"
|
serde_test = "1.0"
|
||||||
|
|
||||||
[features]
|
|
||||||
i128 = ["byteorder/i128"]
|
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ jobs:
|
|||||||
cross: true
|
cross: true
|
||||||
features:
|
features:
|
||||||
- serde
|
- serde
|
||||||
- i128
|
|
||||||
- either
|
- either
|
||||||
|
|
||||||
# Nightly
|
# Nightly
|
||||||
|
|||||||
@@ -539,7 +539,6 @@ pub trait Buf {
|
|||||||
|
|
||||||
/// Gets an unsigned 128 bit integer from `self` in big-endian byte order.
|
/// Gets an unsigned 128 bit integer from `self` in big-endian byte order.
|
||||||
///
|
///
|
||||||
/// **NOTE:** This method requires the `i128` feature.
|
|
||||||
/// The current position is advanced by 16.
|
/// The current position is advanced by 16.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@@ -554,14 +553,12 @@ pub trait Buf {
|
|||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// This function panics if there is not enough remaining data in `self`.
|
/// This function panics if there is not enough remaining data in `self`.
|
||||||
#[cfg(feature = "i128")]
|
|
||||||
fn get_u128(&mut self) -> u128 {
|
fn get_u128(&mut self) -> u128 {
|
||||||
buf_get_impl!(self, 16, BigEndian::read_u128);
|
buf_get_impl!(self, 16, BigEndian::read_u128);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets an unsigned 128 bit integer from `self` in little-endian byte order.
|
/// Gets an unsigned 128 bit integer from `self` in little-endian byte order.
|
||||||
///
|
///
|
||||||
/// **NOTE:** This method requires the `i128` feature.
|
|
||||||
/// The current position is advanced by 16.
|
/// The current position is advanced by 16.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@@ -576,14 +573,12 @@ pub trait Buf {
|
|||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// This function panics if there is not enough remaining data in `self`.
|
/// This function panics if there is not enough remaining data in `self`.
|
||||||
#[cfg(feature = "i128")]
|
|
||||||
fn get_u128_le(&mut self) -> u128 {
|
fn get_u128_le(&mut self) -> u128 {
|
||||||
buf_get_impl!(self, 16, LittleEndian::read_u128);
|
buf_get_impl!(self, 16, LittleEndian::read_u128);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets a signed 128 bit integer from `self` in big-endian byte order.
|
/// Gets a signed 128 bit integer from `self` in big-endian byte order.
|
||||||
///
|
///
|
||||||
/// **NOTE:** This method requires the `i128` feature.
|
|
||||||
/// The current position is advanced by 16.
|
/// The current position is advanced by 16.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@@ -598,14 +593,12 @@ pub trait Buf {
|
|||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// This function panics if there is not enough remaining data in `self`.
|
/// This function panics if there is not enough remaining data in `self`.
|
||||||
#[cfg(feature = "i128")]
|
|
||||||
fn get_i128(&mut self) -> i128 {
|
fn get_i128(&mut self) -> i128 {
|
||||||
buf_get_impl!(self, 16, BigEndian::read_i128);
|
buf_get_impl!(self, 16, BigEndian::read_i128);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets a signed 128 bit integer from `self` in little-endian byte order.
|
/// Gets a signed 128 bit integer from `self` in little-endian byte order.
|
||||||
///
|
///
|
||||||
/// **NOTE:** This method requires the `i128` feature.
|
|
||||||
/// The current position is advanced by 16.
|
/// The current position is advanced by 16.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@@ -620,7 +613,6 @@ pub trait Buf {
|
|||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
/// This function panics if there is not enough remaining data in `self`.
|
/// This function panics if there is not enough remaining data in `self`.
|
||||||
#[cfg(feature = "i128")]
|
|
||||||
fn get_i128_le(&mut self) -> i128 {
|
fn get_i128_le(&mut self) -> i128 {
|
||||||
buf_get_impl!(self, 16, LittleEndian::read_i128);
|
buf_get_impl!(self, 16, LittleEndian::read_i128);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -625,7 +625,6 @@ pub trait BufMut {
|
|||||||
|
|
||||||
/// Writes an unsigned 128 bit integer to `self` in the big-endian byte order.
|
/// Writes an unsigned 128 bit integer to `self` in the big-endian byte order.
|
||||||
///
|
///
|
||||||
/// **NOTE:** This method requires the `i128` feature.
|
|
||||||
/// The current position is advanced by 16.
|
/// The current position is advanced by 16.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@@ -642,7 +641,6 @@ pub trait BufMut {
|
|||||||
///
|
///
|
||||||
/// This function panics if there is not enough remaining capacity in
|
/// This function panics if there is not enough remaining capacity in
|
||||||
/// `self`.
|
/// `self`.
|
||||||
#[cfg(feature = "i128")]
|
|
||||||
fn put_u128(&mut self, n: u128) {
|
fn put_u128(&mut self, n: u128) {
|
||||||
let mut buf = [0; 16];
|
let mut buf = [0; 16];
|
||||||
BigEndian::write_u128(&mut buf, n);
|
BigEndian::write_u128(&mut buf, n);
|
||||||
@@ -651,7 +649,6 @@ pub trait BufMut {
|
|||||||
|
|
||||||
/// Writes an unsigned 128 bit integer to `self` in little-endian byte order.
|
/// Writes an unsigned 128 bit integer to `self` in little-endian byte order.
|
||||||
///
|
///
|
||||||
/// **NOTE:** This method requires the `i128` feature.
|
|
||||||
/// The current position is advanced by 16.
|
/// The current position is advanced by 16.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@@ -668,7 +665,6 @@ pub trait BufMut {
|
|||||||
///
|
///
|
||||||
/// This function panics if there is not enough remaining capacity in
|
/// This function panics if there is not enough remaining capacity in
|
||||||
/// `self`.
|
/// `self`.
|
||||||
#[cfg(feature = "i128")]
|
|
||||||
fn put_u128_le(&mut self, n: u128) {
|
fn put_u128_le(&mut self, n: u128) {
|
||||||
let mut buf = [0; 16];
|
let mut buf = [0; 16];
|
||||||
LittleEndian::write_u128(&mut buf, n);
|
LittleEndian::write_u128(&mut buf, n);
|
||||||
@@ -677,7 +673,6 @@ pub trait BufMut {
|
|||||||
|
|
||||||
/// Writes a signed 128 bit integer to `self` in the big-endian byte order.
|
/// Writes a signed 128 bit integer to `self` in the big-endian byte order.
|
||||||
///
|
///
|
||||||
/// **NOTE:** This method requires the `i128` feature.
|
|
||||||
/// The current position is advanced by 16.
|
/// The current position is advanced by 16.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@@ -694,7 +689,6 @@ pub trait BufMut {
|
|||||||
///
|
///
|
||||||
/// This function panics if there is not enough remaining capacity in
|
/// This function panics if there is not enough remaining capacity in
|
||||||
/// `self`.
|
/// `self`.
|
||||||
#[cfg(feature = "i128")]
|
|
||||||
fn put_i128(&mut self, n: i128) {
|
fn put_i128(&mut self, n: i128) {
|
||||||
let mut buf = [0; 16];
|
let mut buf = [0; 16];
|
||||||
BigEndian::write_i128(&mut buf, n);
|
BigEndian::write_i128(&mut buf, n);
|
||||||
@@ -703,7 +697,6 @@ pub trait BufMut {
|
|||||||
|
|
||||||
/// Writes a signed 128 bit integer to `self` in little-endian byte order.
|
/// Writes a signed 128 bit integer to `self` in little-endian byte order.
|
||||||
///
|
///
|
||||||
/// **NOTE:** This method requires the `i128` feature.
|
|
||||||
/// The current position is advanced by 16.
|
/// The current position is advanced by 16.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
@@ -720,7 +713,6 @@ pub trait BufMut {
|
|||||||
///
|
///
|
||||||
/// This function panics if there is not enough remaining capacity in
|
/// This function panics if there is not enough remaining capacity in
|
||||||
/// `self`.
|
/// `self`.
|
||||||
#[cfg(feature = "i128")]
|
|
||||||
fn put_i128_le(&mut self, n: i128) {
|
fn put_i128_le(&mut self, n: i128) {
|
||||||
let mut buf = [0; 16];
|
let mut buf = [0; 16];
|
||||||
LittleEndian::write_i128(&mut buf, n);
|
LittleEndian::write_i128(&mut buf, n);
|
||||||
|
|||||||
Reference in New Issue
Block a user