diff --git a/Cargo.toml b/Cargo.toml index 7142129..d5cd548 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ description = "An RPC framework for Rust with a focus on ease of use." bincode = "0.6" byteorder = "0.5" bytes = { git = "https://github.com/carllerche/bytes" } -futures = "0.1" +futures = { git = "https://github.com/alexcrichton/futures-rs" } lazy_static = "0.2" log = "0.3" scoped-pool = "1.0" @@ -28,6 +28,7 @@ tokio-core = { git = "https://github.com/tokio-rs/tokio-core" } [replace] "tokio-core:0.1.0" = { git = "https://github.com/tokio-rs/tokio-core" } +"futures:0.1.3" = { git = "https://github.com/alexcrichton/futures-rs" } [dev-dependencies] chrono = "0.2" diff --git a/src/framed.rs b/src/framed.rs index a9e194d..9185239 100644 --- a/src/framed.rs +++ b/src/framed.rs @@ -4,8 +4,7 @@ // This file may not be copied, modified, or distributed except according to those terms. use bincode::{SizeLimit, serde as bincode}; -use byteorder::BigEndian; -use bytes::{Buf, MutBuf}; +use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; use futures::{Async, Poll}; use serde; use std::io::{self, Cursor}; @@ -96,14 +95,14 @@ impl easy::Parse for Parser match self.state { Id if buf.len() < mem::size_of::() => return Ok(Async::NotReady), Id => { - self.state = Len { id: Cursor::new(&*buf.get_mut()).read_u64::() }; + self.state = Len { id: Cursor::new(&*buf.get_mut()).read_u64::()? }; *buf = buf.split_off(mem::size_of::()); } Len { .. } if buf.len() < mem::size_of::() => return Ok(Async::NotReady), Len { id } => { self.state = Payload { id: id, - len: Cursor::new(&*buf.get_mut()).read_u64::(), + len: Cursor::new(&*buf.get_mut()).read_u64::()?, }; *buf = buf.split_off(mem::size_of::()); } @@ -139,8 +138,8 @@ impl easy::Serialize for Serializer type In = (RequestId, T); fn serialize(&mut self, (id, message): Self::In, buf: &mut Vec) { - buf.write_u64::(id); - buf.write_u64::(bincode::serialized_size(&message)); + buf.write_u64::(id).unwrap(); + buf.write_u64::(bincode::serialized_size(&message)).unwrap(); bincode::serialize_into(buf, &message, SizeLimit::Infinite) diff --git a/src/plugins/src/lib.rs b/src/plugins/src/lib.rs index ccc3024..0747c8d 100644 --- a/src/plugins/src/lib.rs +++ b/src/plugins/src/lib.rs @@ -21,7 +21,7 @@ use syntax::tokenstream::TokenTree; use syntax::util::small_vector::SmallVector; fn snake_to_camel(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box { - let mut parser = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg().clone(), tts.into()); + let mut parser = parse::new_parser_from_tts(cx.parse_sess(), tts.into()); // The `expand_expr` method is called so that any macro calls in the // parsed expression are expanded. @@ -69,7 +69,7 @@ fn snake_to_camel(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box Box { - let mut parser = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg().clone(), tts.into()); + let mut parser = parse::new_parser_from_tts(cx.parse_sess(), tts.into()); // The `expand_expr` method is called so that any macro calls in the // parsed expression are expanded. @@ -91,7 +91,7 @@ fn impl_snake_to_camel(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box Box { - let mut parser = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg().clone(), tts.into()); + let mut parser = parse::new_parser_from_tts(cx.parse_sess(), tts.into()); // The `expand_expr` method is called so that any macro calls in the // parsed expression are expanded.