Merge branch 'master' into binary-serializer

Conflicts:
	ipc/codegen/src/codegen.rs
This commit is contained in:
Nikolay Volf
2016-04-22 16:40:16 +03:00
28 changed files with 1429 additions and 942 deletions

View File

@@ -77,7 +77,7 @@ fn push_handshake_struct(cx: &ExtCtxt, push: &mut FnMut(Annotatable)) {
pub struct BinHandshake {
api_version: String,
protocol_version: String,
_reserved: Vec<u8>,
reserved: Vec<u8>,
}
).unwrap();
@@ -305,8 +305,8 @@ pub fn strip_ptr(ty: &P<ast::Ty>) -> P<ast::Ty> {
else { ty.clone() }
}
pub fn has_ptr(ty: &P<ast::Ty>) -> bool {
if let ast::TyKind::Rptr(_, ref ptr_mut) = ty.node {
fn has_ptr(ty: &P<ast::Ty>) -> bool {
if let ast::TyKind::Rptr(_, ref _ptr_mut) = ty.node {
true
}
else { false }
@@ -625,7 +625,7 @@ fn push_client_implementation(
let payload = BinHandshake {
protocol_version: $item_ident::protocol_version().to_string(),
api_version: $item_ident::api_version().to_string(),
_reserved: vec![0u8; 64],
reserved: vec![0u8; 64],
};
let mut socket_ref = self.socket.borrow_mut();

View File

@@ -139,11 +139,11 @@ pub fn push_bin_box(
let serialize_impl = quote_item!(cx,
impl ::serde::ser::Serialize for $ident {
fn serialize<__S>(&self, _serializer: &mut __S) -> ::std::result::Result<(), __S::Error>
fn serialize<__S>(&self, serializer: &mut __S) -> ::std::result::Result<(), __S::Error>
where __S: ::serde::ser::Serializer
{
let &$ident(ref val) = self;
_serializer.serialize_bytes(val.as_slice())
serializer.serialize_bytes(val.as_slice())
}
}).unwrap();