From 9b46caa34baa71e737916705810e18aa26bcc005 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 13 Jun 2023 17:22:33 +0200 Subject: update rmp-serde to v1.1 --- src/message.rs | 4 ++-- src/util.rs | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/message.rs b/src/message.rs index cd40ea7..b0d255c 100644 --- a/src/message.rs +++ b/src/message.rs @@ -155,7 +155,7 @@ impl Req { } pub(crate) fn from_enc(enc: ReqEnc) -> Result { - let msg = rmp_serde::decode::from_read_ref(&enc.msg)?; + let msg = rmp_serde::decode::from_slice(&enc.msg)?; Ok(Req { msg: Arc::new(msg), msg_ser: Some(enc.msg), @@ -316,7 +316,7 @@ impl Resp { } pub(crate) fn from_enc(enc: RespEnc) -> Result { - let msg = rmp_serde::decode::from_read_ref(&enc.msg)?; + let msg = rmp_serde::decode::from_slice(&enc.msg)?; Ok(Self { _phantom: Default::default(), msg, diff --git a/src/util.rs b/src/util.rs index edf8c49..56230b7 100644 --- a/src/util.rs +++ b/src/util.rs @@ -17,9 +17,7 @@ where T: Serialize + ?Sized, { let mut wr = Vec::with_capacity(128); - let mut se = rmp_serde::Serializer::new(&mut wr) - .with_struct_map() - .with_string_variants(); + let mut se = rmp_serde::Serializer::new(&mut wr).with_struct_map(); val.serialize(&mut se)?; Ok(wr) } -- cgit v1.2.3