aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-04-27 16:58:44 +0200
committerAlex Auvolat <alex@adnab.me>2021-04-27 16:58:44 +0200
commitf6f0c6f5151c0cc3da1f0b5345743030c3a62406 (patch)
tree56613f6f51b18ae5d86a1ff8466a06e0eb4cce67
parent7ba1364c08379ab0fbd465bdc532fff1572a25d4 (diff)
downloadgarage-dev-0.3.tar.gz
garage-dev-0.3.zip
cargo fmtdev-0.3
-rw-r--r--src/model/block.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/model/block.rs b/src/model/block.rs
index 5e4347f6..60545d20 100644
--- a/src/model/block.rs
+++ b/src/model/block.rs
@@ -526,15 +526,16 @@ impl BlockManager {
// If compressed data is not less than 7/8 of the size of the original data, i.e. if we
// don't gain a significant margin by compressing, then we store the plain data instead
// so that we don't lose time decompressing it on reads.
- let block_data = if compressed.is_some() && compressed.as_ref().unwrap().len() < (data.len() * 7) / 8 {
- BlockData::Compressed(compressed.unwrap())
- } else {
- BlockData::Plain(data)
- };
+ let block_data =
+ if compressed.is_some() && compressed.as_ref().unwrap().len() < (data.len() * 7) / 8 {
+ BlockData::Compressed(compressed.unwrap())
+ } else {
+ BlockData::Plain(data)
+ };
let message = Message::PutBlock {
- hash,
- data: block_data,
+ hash,
+ data: block_data,
};
let who = self.replication.write_nodes(&hash);
self.rpc_client