Skip to content

Commit

Permalink
Merge pull request jonhoo#28 from amilkov3/bytes-1.0
Browse files Browse the repository at this point in the history
bytes 0.6 -> 1.0
  • Loading branch information
blackbeam authored Jan 5, 2021
2 parents dd00e01 + acd60dc commit caa02b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/proto/codec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions src/proto/sync_framed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit caa02b6

Please sign in to comment.