aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/model')
-rw-r--r--src/model/Cargo.toml2
-rw-r--r--src/model/index_counter.rs8
-rw-r--r--src/model/key_table.rs2
-rw-r--r--src/model/migrate.rs2
-rw-r--r--src/model/s3/object_table.rs2
-rw-r--r--src/model/s3/version_table.rs2
6 files changed, 10 insertions, 8 deletions
diff --git a/src/model/Cargo.toml b/src/model/Cargo.toml
index 322feee1..d908dc01 100644
--- a/src/model/Cargo.toml
+++ b/src/model/Cargo.toml
@@ -31,7 +31,7 @@ tracing = "0.1.30"
rand = "0.8"
zstd = { version = "0.9", default-features = false }
-rmp-serde = "1.1"
+rmp-serde = "0.15"
serde = { version = "1.0", default-features = false, features = ["derive", "rc"] }
serde_bytes = "0.11"
diff --git a/src/model/index_counter.rs b/src/model/index_counter.rs
index d8c1229a..6f81be3e 100644
--- a/src/model/index_counter.rs
+++ b/src/model/index_counter.rs
@@ -181,9 +181,11 @@ impl<T: CounterSchema> IndexCounter<T> {
let new_entry = self.local_counter.db().transaction(|mut tx| {
let mut entry = match tx.get(&self.local_counter, &tree_key[..])? {
- Some(old_bytes) => rmp_serde::decode::from_slice::<LocalCounterEntry>(&old_bytes)
- .map_err(Error::RmpDecode)
- .map_err(db::TxError::Abort)?,
+ Some(old_bytes) => {
+ rmp_serde::decode::from_read_ref::<_, LocalCounterEntry>(&old_bytes)
+ .map_err(Error::RmpDecode)
+ .map_err(db::TxError::Abort)?
+ }
None => LocalCounterEntry {
values: BTreeMap::new(),
},
diff --git a/src/model/key_table.rs b/src/model/key_table.rs
index 852bf607..330e83f0 100644
--- a/src/model/key_table.rs
+++ b/src/model/key_table.rs
@@ -175,7 +175,7 @@ impl TableSchema for KeyTable {
}
fn try_migrate(bytes: &[u8]) -> Option<Self::E> {
- let old_k = rmp_serde::decode::from_slice::<old::Key>(bytes).ok()?;
+ let old_k = rmp_serde::decode::from_read_ref::<_, old::Key>(bytes).ok()?;
let name = crdt::Lww::raw(old_k.name.timestamp(), old_k.name.get().clone());
let state = if old_k.deleted.get() {
diff --git a/src/model/migrate.rs b/src/model/migrate.rs
index bfd9845b..25acb4b0 100644
--- a/src/model/migrate.rs
+++ b/src/model/migrate.rs
@@ -28,7 +28,7 @@ impl Migrate {
let mut old_buckets = vec![];
for res in tree.iter().map_err(GarageError::from)? {
let (_k, v) = res.map_err(GarageError::from)?;
- let bucket = rmp_serde::decode::from_slice::<old_bucket::Bucket>(&v[..])
+ let bucket = rmp_serde::decode::from_read_ref::<_, old_bucket::Bucket>(&v[..])
.map_err(GarageError::from)?;
old_buckets.push(bucket);
}
diff --git a/src/model/s3/object_table.rs b/src/model/s3/object_table.rs
index c242b325..3d9a89f7 100644
--- a/src/model/s3/object_table.rs
+++ b/src/model/s3/object_table.rs
@@ -270,7 +270,7 @@ impl TableSchema for ObjectTable {
}
fn try_migrate(bytes: &[u8]) -> Option<Self::E> {
- let old_obj = rmp_serde::decode::from_slice::<old::Object>(bytes).ok()?;
+ let old_obj = rmp_serde::decode::from_read_ref::<_, old::Object>(bytes).ok()?;
Some(migrate_object(old_obj))
}
}
diff --git a/src/model/s3/version_table.rs b/src/model/s3/version_table.rs
index f67f2ff1..ad096772 100644
--- a/src/model/s3/version_table.rs
+++ b/src/model/s3/version_table.rs
@@ -168,7 +168,7 @@ impl TableSchema for VersionTable {
}
fn try_migrate(bytes: &[u8]) -> Option<Self::E> {
- let old = rmp_serde::decode::from_slice::<old::Version>(bytes).ok()?;
+ let old = rmp_serde::decode::from_read_ref::<_, old::Version>(bytes).ok()?;
let blocks = old
.blocks