diff options
author | Alex Auvolat <alex@adnab.me> | 2020-04-28 10:18:14 +0000 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-04-28 10:18:14 +0000 |
commit | 0957d0fdfadb27e49c24d63994f52197a9c9cd1c (patch) | |
tree | 35b048599d44de01650d99ccc2de942498ac4038 /src/core | |
parent | be35cbdce2bd4e42a2bfc41ff5b21e332d20eb29 (diff) | |
download | garage-0957d0fdfadb27e49c24d63994f52197a9c9cd1c.tar.gz garage-0957d0fdfadb27e49c24d63994f52197a9c9cd1c.zip |
Work on API
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/version_table.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/version_table.rs b/src/core/version_table.rs index 66f737bb..6054e389 100644 --- a/src/core/version_table.rs +++ b/src/core/version_table.rs @@ -49,7 +49,10 @@ impl Version { } /// Adds a block if it wasn't already present pub fn add_block(&mut self, new: VersionBlock) -> Result<(), ()> { - match self.blocks.binary_search_by(|b| b.cmp_key().cmp(&new.cmp_key())) { + match self + .blocks + .binary_search_by(|b| b.cmp_key().cmp(&new.cmp_key())) + { Err(i) => { self.blocks.insert(i, new); Ok(()) @@ -90,7 +93,10 @@ impl Entry<Hash, EmptyKey> for Version { self.blocks.clear(); } else if !self.deleted { for bi in other.blocks.iter() { - match self.blocks.binary_search_by(|x| x.cmp_key().cmp(&bi.cmp_key())) { + match self + .blocks + .binary_search_by(|x| x.cmp_key().cmp(&bi.cmp_key())) + { Ok(_) => (), Err(pos) => { self.blocks.insert(pos, bi.clone()); |