diff options
author | 2022-01-24 08:58:05 +0000 | |
---|---|---|
committer | 2022-01-24 09:58:05 +0100 | |
commit | 0e3b2466f199375031006857164fbf70e3ea479f (patch) | |
tree | db22384c238a578fde1c7f4572338fa7744b6876 /src/bytes.rs | |
parent | 68afb40df9ea2e61a93d0e26f6f8a9f231979452 (diff) | |
download | bytes-0e3b2466f199375031006857164fbf70e3ea479f.tar.gz bytes-0e3b2466f199375031006857164fbf70e3ea479f.tar.zst bytes-0e3b2466f199375031006857164fbf70e3ea479f.zip |
Address various clippy warnings (#528)
Diffstat (limited to 'src/bytes.rs')
-rw-r--r-- | src/bytes.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bytes.rs b/src/bytes.rs index c4fbd4a..f3e4c5c 100644 --- a/src/bytes.rs +++ b/src/bytes.rs @@ -262,7 +262,7 @@ impl Bytes { let mut ret = self.clone(); ret.len = end - begin; - ret.ptr = unsafe { ret.ptr.offset(begin as isize) }; + ret.ptr = unsafe { ret.ptr.add(begin) }; ret } @@ -501,7 +501,7 @@ impl Bytes { // should already be asserted, but debug assert for tests debug_assert!(self.len >= by, "internal: inc_start out of bounds"); self.len -= by; - self.ptr = self.ptr.offset(by as isize); + self.ptr = self.ptr.add(by); } } @@ -604,7 +604,7 @@ impl<'a> IntoIterator for &'a Bytes { type IntoIter = core::slice::Iter<'a, u8>; fn into_iter(self) -> Self::IntoIter { - self.as_slice().into_iter() + self.as_slice().iter() } } @@ -686,7 +686,7 @@ impl PartialOrd<Bytes> for str { impl PartialEq<Vec<u8>> for Bytes { fn eq(&self, other: &Vec<u8>) -> bool { - *self == &other[..] + *self == other[..] } } @@ -710,7 +710,7 @@ impl PartialOrd<Bytes> for Vec<u8> { impl PartialEq<String> for Bytes { fn eq(&self, other: &String) -> bool { - *self == &other[..] + *self == other[..] } } |