Skip to content

Commit

Permalink
Merge pull request snapview#163 from nickelc/bytes
Browse files Browse the repository at this point in the history
Update to bytes 1.0
  • Loading branch information
daniel-abramov committed Dec 30, 2020
2 parents 56239c8 + 75bf9b8 commit b0a6bae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ tls-vendored = ["native-tls", "native-tls/vendored"]
[dependencies]
base64 = "0.13.0"
byteorder = "1.3.2"
bytes = "0.5"
bytes = "1.0"
http = "0.2"
httparse = "1.3.4"
input_buffer = "0.3.0"
input_buffer = { version = "0.4.0", git = "https://github.com/snapview/input_buffer.git" }
log = "0.4.8"
rand = "0.8.0"
sha-1 = "0.9"
Expand Down
4 changes: 2 additions & 2 deletions src/handshake/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<Stream: Read + Write> HandshakeMachine<Stream> {
.no_block()?;
match read {
Some(0) => Err(Error::Protocol("Handshake not finished".into())),
Some(_) => Ok(if let Some((size, obj)) = Obj::try_parse(Buf::bytes(&buf))? {
Some(_) => Ok(if let Some((size, obj)) = Obj::try_parse(Buf::chunk(&buf))? {
buf.advance(size);
RoundResult::StageFinished(StageResult::DoneReading {
result: obj,
Expand All @@ -72,7 +72,7 @@ impl<Stream: Read + Write> HandshakeMachine<Stream> {
}
HandshakeState::Writing(mut buf) => {
assert!(buf.has_remaining());
if let Some(size) = self.stream.write(Buf::bytes(&buf)).no_block()? {
if let Some(size) = self.stream.write(Buf::chunk(&buf)).no_block()? {
assert!(size > 0);
buf.advance(size);
Ok(if buf.has_remaining() {
Expand Down

0 comments on commit b0a6bae

Please sign in to comment.