From acd60dc6d7508a0300a0f93fa557df7e16659eed Mon Sep 17 00:00:00 2001 From: Alex Milkov Date: Sat, 26 Dec 2020 01:20:50 -0500 Subject: [PATCH] bytes 0.6 -> 1.0 --- Cargo.toml | 2 +- src/proto/codec/mod.rs | 4 ++-- src/proto/sync_framed.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1660b1d..7553990 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ base64 = "0.13" bigdecimal = { version = "0.2", features = ["serde"] } bitflags = "1" byteorder = "1" -bytes = "0.6.0" +bytes = "1.0" chrono = { version = "0.4", features = ["serde"] } flate2 = { version = "1.0", default-features = false } lazy_static = "1" diff --git a/src/proto/codec/mod.rs b/src/proto/codec/mod.rs index 2d912d8..acae577 100644 --- a/src/proto/codec/mod.rs +++ b/src/proto/codec/mod.rs @@ -75,7 +75,7 @@ pub fn compress( let mut read = 0; loop { dst.reserve(max(chunk.len().saturating_sub(read), 1)); - let dst_buf = &mut dst.bytes_mut()[7 + read..]; + let dst_buf = &mut dst.chunk_mut()[7 + read..]; match encoder.read(&mut *slice_from_raw_parts_mut( dst_buf.as_mut_ptr(), dst_buf.len(), @@ -315,7 +315,7 @@ impl CompDecoder { dst.reserve(plain_len.get()); unsafe { let mut decoder = ZlibDecoder::new(&src[..needed.get()]); - let dst_buf = &mut dst.bytes_mut()[..plain_len.get()]; + let dst_buf = &mut dst.chunk_mut()[..plain_len.get()]; decoder.read_exact(&mut *slice_from_raw_parts_mut( dst_buf.as_mut_ptr(), dst_buf.len(), diff --git a/src/proto/sync_framed.rs b/src/proto/sync_framed.rs index 317a4e4..039708b 100644 --- a/src/proto/sync_framed.rs +++ b/src/proto/sync_framed.rs @@ -152,8 +152,8 @@ where None => unsafe { self.in_buf.reserve(1); match with_interrupt!(self.stream.read(&mut *slice_from_raw_parts_mut( - self.in_buf.bytes_mut().as_mut_ptr(), - self.in_buf.bytes_mut().len() + self.in_buf.chunk_mut().as_mut_ptr(), + self.in_buf.chunk_mut().len() ))) { Ok(0) => self.eof = true, Ok(x) => {