Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tomg10 committed Dec 18, 2023
1 parent 4b22712 commit 565384b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/lib/object_store/src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ impl StoredObject for SnapshotFactoryDependencies {

fn serialize(&self) -> Result<Vec<u8>, BoxedError> {
let mut encoder = GzEncoder::new(Vec::new(), Compression::default());
encoder.write_all(&(self.build().encode_to_vec()))?;
let encoded_bytes = self.build().encode_to_vec();
encoder.write_all(&encoded_bytes)?;
encoder.finish().map_err(From::from)
}

Expand All @@ -94,10 +95,7 @@ impl StoredObject for SnapshotFactoryDependencies {
decoder
.read_to_end(&mut decompressed_bytes)
.map_err(BoxedError::from)?;
let proto =
<SnapshotFactoryDependencies as ProtoFmt>::Proto::decode(&decompressed_bytes[..])
.context("decode SnapshotFactoryDependencies")?;
SnapshotFactoryDependencies::read(&proto)
decode(&decompressed_bytes[..])
.context("deserialization of Message to SnapshotFactoryDependencies")
.map_err(From::from)
}
Expand Down

0 comments on commit 565384b

Please sign in to comment.