update rmp-serde to v1.1
This commit is contained in:
parent
e3b04e83d7
commit
9b46caa34b
4 changed files with 8 additions and 10 deletions
6
Cargo.lock
generated
6
Cargo.lock
generated
|
@ -525,7 +525,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "netapp"
|
name = "netapp"
|
||||||
version = "0.6.1"
|
version = "0.7.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arc-swap",
|
"arc-swap",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
@ -797,9 +797,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rmp-serde"
|
name = "rmp-serde"
|
||||||
version = "0.15.5"
|
version = "1.1.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "723ecff9ad04f4ad92fe1c8ca6c20d2196d9286e9c60727c4cb5511629260e9d"
|
checksum = "c5b13be192e0220b8afb7222aa5813cb62cc269ebb5cac346ca6487681d2913e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"rmp",
|
"rmp",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "netapp"
|
name = "netapp"
|
||||||
version = "0.6.1"
|
version = "0.7.0"
|
||||||
authors = ["Alex Auvolat <alex@adnab.me>"]
|
authors = ["Alex Auvolat <alex@adnab.me>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
license-file = "LICENSE"
|
license-file = "LICENSE"
|
||||||
|
@ -27,7 +27,7 @@ tokio-util = { version = "0.7", default-features = false, features = ["compat",
|
||||||
tokio-stream = "0.1.7"
|
tokio-stream = "0.1.7"
|
||||||
|
|
||||||
serde = { version = "1.0", default-features = false, features = ["derive", "rc"] }
|
serde = { version = "1.0", default-features = false, features = ["derive", "rc"] }
|
||||||
rmp-serde = "0.15"
|
rmp-serde = "1.1"
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
|
|
||||||
rand = { version = "0.8" }
|
rand = { version = "0.8" }
|
||||||
|
|
|
@ -155,7 +155,7 @@ impl<M: Message> Req<M> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn from_enc(enc: ReqEnc) -> Result<Self, rmp_serde::decode::Error> {
|
pub(crate) fn from_enc(enc: ReqEnc) -> Result<Self, rmp_serde::decode::Error> {
|
||||||
let msg = rmp_serde::decode::from_read_ref(&enc.msg)?;
|
let msg = rmp_serde::decode::from_slice(&enc.msg)?;
|
||||||
Ok(Req {
|
Ok(Req {
|
||||||
msg: Arc::new(msg),
|
msg: Arc::new(msg),
|
||||||
msg_ser: Some(enc.msg),
|
msg_ser: Some(enc.msg),
|
||||||
|
@ -316,7 +316,7 @@ impl<M: Message> Resp<M> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn from_enc(enc: RespEnc) -> Result<Self, Error> {
|
pub(crate) fn from_enc(enc: RespEnc) -> Result<Self, Error> {
|
||||||
let msg = rmp_serde::decode::from_read_ref(&enc.msg)?;
|
let msg = rmp_serde::decode::from_slice(&enc.msg)?;
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
_phantom: Default::default(),
|
_phantom: Default::default(),
|
||||||
msg,
|
msg,
|
||||||
|
|
|
@ -17,9 +17,7 @@ where
|
||||||
T: Serialize + ?Sized,
|
T: Serialize + ?Sized,
|
||||||
{
|
{
|
||||||
let mut wr = Vec::with_capacity(128);
|
let mut wr = Vec::with_capacity(128);
|
||||||
let mut se = rmp_serde::Serializer::new(&mut wr)
|
let mut se = rmp_serde::Serializer::new(&mut wr).with_struct_map();
|
||||||
.with_struct_map()
|
|
||||||
.with_string_variants();
|
|
||||||
val.serialize(&mut se)?;
|
val.serialize(&mut se)?;
|
||||||
Ok(wr)
|
Ok(wr)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue