aboutsummaryrefslogtreecommitdiff
path: root/src/util/migrate.rs
diff options
context:
space:
mode:
authorJonathan Davies <jpds@protonmail.com>2023-01-23 23:02:22 +0000
committerJonathan Davies <jpds@protonmail.com>2023-01-26 11:03:43 +0000
commitdb56d4658fab4a9c99a415550510daf0c2dc6dd2 (patch)
tree598324dfe4c5f37db333699d6797956aa6aa4e9a /src/util/migrate.rs
parent12a4e1f303336b6ee77417d84eebd9d38be92699 (diff)
downloadgarage-db56d4658fab4a9c99a415550510daf0c2dc6dd2.tar.gz
garage-db56d4658fab4a9c99a415550510daf0c2dc6dd2.zip
util/Cargo.toml: Updated rmp-serde from 0.15 to 1.1.
Diffstat (limited to 'src/util/migrate.rs')
-rw-r--r--src/util/migrate.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/util/migrate.rs b/src/util/migrate.rs
index 1229fd9c..5b708cc8 100644
--- a/src/util/migrate.rs
+++ b/src/util/migrate.rs
@@ -19,7 +19,7 @@ pub trait Migrate: Serialize + for<'de> Deserialize<'de> + 'static {
fn decode(bytes: &[u8]) -> Option<Self> {
let marker_len = Self::VERSION_MARKER.len();
if bytes.get(..marker_len) == Some(Self::VERSION_MARKER) {
- if let Ok(value) = rmp_serde::decode::from_read_ref::<_, Self>(&bytes[marker_len..]) {
+ if let Ok(value) = rmp_serde::decode::from_slice::<_>(&bytes[marker_len..]) {
return Some(value);
}
}
@@ -31,9 +31,7 @@ pub trait Migrate: Serialize + for<'de> Deserialize<'de> + 'static {
fn encode(&self) -> Result<Vec<u8>, rmp_serde::encode::Error> {
let mut wr = Vec::with_capacity(128);
wr.extend_from_slice(Self::VERSION_MARKER);
- 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();
self.serialize(&mut se)?;
Ok(wr)
}