aboutsummaryrefslogtreecommitdiff
path: root/src/table/merkle.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-06-03 12:35:12 +0200
committerAlex Auvolat <alex@adnab.me>2022-06-03 12:35:12 +0200
commit4bf706b170f149f54fd701576692cd5cd5bc9779 (patch)
tree9f85ddd71c76edfdbc7cfd0d016ae059bc5326e5 /src/table/merkle.rs
parentbd9ff432d716020d7235ece76257b60dc3ead95a (diff)
downloadgarage-4bf706b170f149f54fd701576692cd5cd5bc9779.tar.gz
garage-4bf706b170f149f54fd701576692cd5cd5bc9779.zip
Slightly prettier code
Diffstat (limited to 'src/table/merkle.rs')
-rw-r--r--src/table/merkle.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/table/merkle.rs b/src/table/merkle.rs
index 48d2c5dd..c6653a64 100644
--- a/src/table/merkle.rs
+++ b/src/table/merkle.rs
@@ -110,13 +110,7 @@ where
}
fn updater_loop_iter(&self) -> Result<bool, Error> {
- // TODO undo this iter hack
- let mut iter = self.data.merkle_todo.iter()?;
- if let Some(x) = iter.next() {
- let (key, valhash) = x?;
- let key = key.to_vec();
- let valhash = valhash.to_vec();
- drop(iter);
+ if let Some((key, valhash)) = self.data.merkle_todo.first()? {
self.update_item(&key, &valhash)?;
Ok(true)
} else {