summaryrefslogtreecommitdiff
path: root/src/benchmark.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-05-24 08:55:14 +0300
committerLars Wirzenius <liw@liw.fi>2021-05-29 11:41:15 +0300
commit6de230c382a4329df00bc11cc1ffb90390b13159 (patch)
treed4f0668be0d5cd07ea32af2b0978696658532122 /src/benchmark.rs
parent566dd94d2e46c489b50d84a1fd24683460e5cfdc (diff)
downloadobnam2-6de230c382a4329df00bc11cc1ffb90390b13159.tar.gz
refactor: make metadata be part of datachunk
This makes it harder to lose the metadata for a chunk, or to use unrelated metadata and chunk. Also, soon I will refactor things for encrypting chunks, which will need metadata embedded in the encrypted chunk. Sponsored-by: author
Diffstat (limited to 'src/benchmark.rs')
-rw-r--r--src/benchmark.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/benchmark.rs b/src/benchmark.rs
index d214939..3c94f92 100644
--- a/src/benchmark.rs
+++ b/src/benchmark.rs
@@ -15,7 +15,7 @@ impl ChunkGenerator {
}
impl Iterator for ChunkGenerator {
- type Item = (ChunkId, String, ChunkMeta, DataChunk);
+ type Item = (ChunkId, String, DataChunk);
fn next(&mut self) -> Option<Self::Item> {
if self.next >= self.goal {
@@ -24,9 +24,9 @@ impl Iterator for ChunkGenerator {
let id = ChunkId::recreate(&format!("{}", self.next));
let checksum = id.sha256();
let meta = ChunkMeta::new(&checksum);
- let chunk = DataChunk::new(vec![]);
+ let chunk = DataChunk::new(vec![], meta);
self.next += 1;
- Some((id, checksum, meta, chunk))
+ Some((id, checksum, chunk))
}
}
}