summaryrefslogtreecommitdiff
path: root/src/bin/benchmark-index.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-06-04 06:35:14 +0000
committerLars Wirzenius <liw@liw.fi>2021-06-04 06:35:14 +0000
commitf2a274ee1291531c1154176bca5b9a47e9c234bd (patch)
tree6721b515739c6e5f9236ffd6f4ecc2dfecc471d2 /src/bin/benchmark-index.rs
parentcb33088dbedf4b772013f83b8226047cc4355dd2 (diff)
parent9c2590d2428f0d3de882686ec2ec5832e7123c62 (diff)
downloadobnam2-f2a274ee1291531c1154176bca5b9a47e9c234bd.tar.gz
Merge branch 'aead' into 'main'
add encryption of individual chunks Closes #110 See merge request larswirzenius/obnam!146
Diffstat (limited to 'src/bin/benchmark-index.rs')
-rw-r--r--src/bin/benchmark-index.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bin/benchmark-index.rs b/src/bin/benchmark-index.rs
index 9baa327..b5a059c 100644
--- a/src/bin/benchmark-index.rs
+++ b/src/bin/benchmark-index.rs
@@ -60,7 +60,8 @@ fn create(chunks: &Path, num: u32) -> anyhow::Result<()> {
let mut index = Index::new(chunks)?;
let gen = ChunkGenerator::new(num);
- for (id, _, meta, _) in gen {
+ for (id, _, chunk) in gen {
+ let meta = (*chunk.meta()).clone();
index.insert_meta(id, meta)?;
}
@@ -82,8 +83,8 @@ fn lookup(index: &mut Index, num: u32) -> anyhow::Result<()> {
loop {
let gen = ChunkGenerator::new(num);
- for (_, _, meta, _) in gen {
- index.find_by_sha256(&meta.sha256())?;
+ for (_, _, chunk) in gen {
+ index.find_by_sha256(&chunk.meta().sha256())?;
done += 1;
if done >= num {
return Ok(());