aboutsummaryrefslogtreecommitdiff
path: root/src/model/object_table.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-12-22 18:50:08 +0100
committerAlex Auvolat <alex@adnab.me>2022-01-04 12:47:28 +0100
commitd8ab5bdc3e20759e5ba8a6844393757da3539372 (patch)
tree7fc9abc578bb4185691313889ed94aedca09dbc4 /src/model/object_table.rs
parentc7d5c732442c5802058b46205d450d4620772b7b (diff)
downloadgarage-d8ab5bdc3e20759e5ba8a6844393757da3539372.tar.gz
garage-d8ab5bdc3e20759e5ba8a6844393757da3539372.zip
New buckets for 0.6.0: fix model and migration
Diffstat (limited to 'src/model/object_table.rs')
-rw-r--r--src/model/object_table.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/model/object_table.rs b/src/model/object_table.rs
index 45f0daf4..0c6c3a6d 100644
--- a/src/model/object_table.rs
+++ b/src/model/object_table.rs
@@ -259,11 +259,8 @@ impl TableSchema for ObjectTable {
}
fn try_migrate(bytes: &[u8]) -> Option<Self::E> {
- let old_v = match rmp_serde::decode::from_read_ref::<_, old::Object>(bytes) {
- Ok(x) => x,
- Err(_) => return None,
- };
- Some(migrate_object(old_v))
+ let old_obj = rmp_serde::decode::from_read_ref::<_, old::Object>(bytes).ok()?;
+ Some(migrate_object(old_obj))
}
}