diff options
Diffstat (limited to 'src/model/object_table.rs')
-rw-r--r-- | src/model/object_table.rs | 7 |
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)) } } |