From 329acdb2fcc7e787b93969e976c48167a79634a9 Mon Sep 17 00:00:00 2001 From: Walnut <39544927+Walnut356@users.noreply.github.com> Date: Wed, 16 Aug 2023 22:34:27 -0500 Subject: [PATCH] added inlining for Bytes get_X functions --- src/bytes.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/bytes.rs b/src/bytes.rs index 225dbcd68..fc4dccf1d 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -585,98 +585,122 @@ impl Buf for Bytes { } } + #[inline] fn get_u16(&mut self) -> u16 { buf_get_impl!(self, u16::from_be_bytes); } + #[inline] fn get_u16_le(&mut self) -> u16 { buf_get_impl!(self, u16::from_le_bytes); } + #[inline] fn get_u16_ne(&mut self) -> u16 { buf_get_impl!(self, u16::from_ne_bytes); } + #[inline] fn get_i16(&mut self) -> i16 { buf_get_impl!(self, i16::from_be_bytes); } + #[inline] fn get_i16_le(&mut self) -> i16 { buf_get_impl!(self, i16::from_le_bytes); } + #[inline] fn get_i16_ne(&mut self) -> i16 { buf_get_impl!(self, i16::from_ne_bytes); } + #[inline] fn get_u32(&mut self) -> u32 { buf_get_impl!(self, u32::from_be_bytes); } + #[inline] fn get_u32_le(&mut self) -> u32 { buf_get_impl!(self, u32::from_le_bytes); } + #[inline] fn get_u32_ne(&mut self) -> u32 { buf_get_impl!(self, u32::from_ne_bytes); } + #[inline] fn get_i32(&mut self) -> i32 { buf_get_impl!(self, i32::from_be_bytes); } + #[inline] fn get_i32_le(&mut self) -> i32 { buf_get_impl!(self, i32::from_le_bytes); } + #[inline] fn get_i32_ne(&mut self) -> i32 { buf_get_impl!(self, i32::from_ne_bytes); } + #[inline] fn get_u64(&mut self) -> u64 { buf_get_impl!(self, u64::from_be_bytes); } + #[inline] fn get_u64_le(&mut self) -> u64 { buf_get_impl!(self, u64::from_le_bytes); } + #[inline] fn get_u64_ne(&mut self) -> u64 { buf_get_impl!(self, u64::from_ne_bytes); } + #[inline] fn get_i64(&mut self) -> i64 { buf_get_impl!(self, i64::from_be_bytes); } + #[inline] fn get_i64_le(&mut self) -> i64 { buf_get_impl!(self, i64::from_le_bytes); } + #[inline] fn get_i64_ne(&mut self) -> i64 { buf_get_impl!(self, i64::from_ne_bytes); } + #[inline] fn get_u128(&mut self) -> u128 { buf_get_impl!(self, u128::from_be_bytes); } + #[inline] fn get_u128_le(&mut self) -> u128 { buf_get_impl!(self, u128::from_le_bytes); } + #[inline] fn get_u128_ne(&mut self) -> u128 { buf_get_impl!(self, u128::from_ne_bytes); } + #[inline] fn get_i128(&mut self) -> i128 { buf_get_impl!(self, i128::from_be_bytes); } + #[inline] fn get_i128_le(&mut self) -> i128 { buf_get_impl!(self, i128::from_le_bytes); } + #[inline] fn get_i128_ne(&mut self) -> i128 { buf_get_impl!(self, i128::from_ne_bytes); }