diff --git a/Cargo.toml b/Cargo.toml index 8bab60ae3..7809884eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ categories = ["algorithms", "database-implementations"] [dependencies] log = "0.4.1" -protobuf = "2.0" +protobuf = "~2.0.0" quick-error = "1.2.1" rand = "0.4" fxhash = "0.2.1" diff --git a/generate-proto.sh b/generate-proto.sh new file mode 100755 index 000000000..ebe10c8cc --- /dev/null +++ b/generate-proto.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +protoc proto/eraftpb.proto --rust_out=src/ +# TODO: remove this once stepancheg/rust-protobuf#233 is resolved. +python < { - ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.entry_type, 1, &mut self.unknown_fields)? + if wire_type == ::protobuf::wire_format::WireTypeVarint {self.entry_type = is.read_enum()?;} else { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); } }, 2 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { @@ -1095,7 +1095,7 @@ impl ::protobuf::Message for Message { let (field_number, wire_type) = is.read_tag_unpack()?; match field_number { 1 => { - ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.msg_type, 1, &mut self.unknown_fields)? + if wire_type == ::protobuf::wire_format::WireTypeVarint {self.msg_type = is.read_enum()?;} else { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); } }, 2 => { if wire_type != ::protobuf::wire_format::WireTypeVarint { @@ -1945,7 +1945,7 @@ impl ::protobuf::Message for ConfChange { self.id = tmp; }, 2 => { - ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.change_type, 2, &mut self.unknown_fields)? + if wire_type == ::protobuf::wire_format::WireTypeVarint {self.change_type = is.read_enum()?;} else { return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); } }, 3 => { if wire_type != ::protobuf::wire_format::WireTypeVarint {