src/client/pull.rs: simplify code

This commit is contained in:
Dietmar Maurer 2020-09-26 10:09:51 +02:00
parent b02b374b46
commit 636e674ee7
1 changed files with 2 additions and 3 deletions

View File

@ -50,13 +50,12 @@ async fn pull_index_chunks<I: IndexFile>(
})
);
let target2 = target.clone();
let verify_pool = ParallelHandler::new(
"sync chunk writer", 4,
move |(chunk, digest, size): (DataBlob, [u8;32], u64)| {
|(chunk, digest, size): (DataBlob, [u8;32], u64)| {
// println!("verify and write {}", proxmox::tools::digest_to_hex(&digest));
chunk.verify_unencrypted(size as usize, &digest)?;
target2.insert_chunk(&chunk, &digest)?;
target.insert_chunk(&chunk, &digest)?;
Ok(())
}
);