From 16e0a655d0d01e3871aee81a0a9660102d6df74e Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 3 Jun 2022 14:16:30 +0200 Subject: Update rmp-serde --- src/util/Cargo.toml | 2 +- src/util/data.rs | 2 +- src/util/persister.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/util') diff --git a/src/util/Cargo.toml b/src/util/Cargo.toml index 5d073436..e68704ad 100644 --- a/src/util/Cargo.toml +++ b/src/util/Cargo.toml @@ -25,7 +25,7 @@ rand = "0.8" sha2 = "0.9" chrono = "0.4" -rmp-serde = "0.15" +rmp-serde = "1.1" serde = { version = "1.0", default-features = false, features = ["derive", "rc"] } serde_json = "1.0" toml = "0.5" diff --git a/src/util/data.rs b/src/util/data.rs index 7715c2cc..2ef976a5 100644 --- a/src/util/data.rs +++ b/src/util/data.rs @@ -151,7 +151,7 @@ where let mut wr = Vec::with_capacity(128); let mut se = rmp_serde::Serializer::new(&mut wr) .with_struct_map() - .with_string_variants(); + .with_binary(); val.serialize(&mut se)?; Ok(wr) } diff --git a/src/util/persister.rs b/src/util/persister.rs index 9e1a1910..d0759db7 100644 --- a/src/util/persister.rs +++ b/src/util/persister.rs @@ -33,7 +33,7 @@ where let mut bytes = vec![]; file.read_to_end(&mut bytes)?; - let value = rmp_serde::decode::from_read_ref(&bytes[..])?; + let value = rmp_serde::decode::from_slice(&bytes[..])?; Ok(value) } @@ -57,7 +57,7 @@ where let mut bytes = vec![]; file.read_to_end(&mut bytes).await?; - let value = rmp_serde::decode::from_read_ref(&bytes[..])?; + let value = rmp_serde::decode::from_slice(&bytes[..])?; Ok(value) } -- cgit v1.2.3