From 0957d0fdfadb27e49c24d63994f52197a9c9cd1c Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 28 Apr 2020 10:18:14 +0000 Subject: Work on API --- src/core/version_table.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/core/version_table.rs') 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 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()); -- cgit v1.2.3