Skip to content

Commit f4018a4

Browse files
ms705tikue
authored andcommitted
bincode 1.0.0-alpha6 changed SizeLimit to a trait (google#134)
Unfortunately, cargo's semantic versioning gets confused by the "-alpha" suffix in current bincode versions (I think): even though tarpc's Cargo.toml specified version "1.0.0-alpha4", cargo will download the more recent "1.0.0-alpha6", which has breaking changes to the `SizeLimit` enum. This change makes tarpc work with bincode 1.0.0-alpha6 and updates the dependency.
1 parent 79aee18 commit f4018a4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ description = "An RPC framework for Rust with a focus on ease of use."
1515
travis-ci = { repository = "google/tarpc" }
1616

1717
[dependencies]
18-
bincode = "1.0.0-alpha4"
18+
bincode = "1.0.0-alpha6"
1919
byteorder = "1.0"
2020
cfg-if = "0.1.0"
2121
futures = "0.1.7"

src/protocol.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This file may not be copied, modified, or distributed except according to those terms.
55

66
use {serde, tokio_core};
7-
use bincode::{self, SizeLimit};
7+
use bincode::{self, Infinite};
88
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
99
use std::io::{self, Cursor};
1010
use std::marker::PhantomData;
@@ -47,7 +47,7 @@ impl<Encode, Decode> tokio_core::io::Codec for Codec<Encode, Decode>
4747
buf.write_u64::<BigEndian>(bincode::serialized_size(&message)).unwrap();
4848
bincode::serialize_into(buf,
4949
&message,
50-
SizeLimit::Infinite)
50+
Infinite)
5151
.map_err(|serialize_err| io::Error::new(io::ErrorKind::Other, serialize_err))?;
5252
trace!("Encoded buffer: {:?}", buf);
5353
Ok(())
@@ -91,7 +91,7 @@ impl<Encode, Decode> tokio_core::io::Codec for Codec<Encode, Decode>
9191
Payload { id, len } => {
9292
let payload = buf.drain_to(len as usize);
9393
let result = bincode::deserialize_from(&mut Cursor::new(payload),
94-
SizeLimit::Infinite);
94+
Infinite);
9595
// Reset the state machine because, either way, we're done processing this
9696
// message.
9797
self.state = Id;

0 commit comments

Comments
 (0)