src/tools/parallel_handler.rs: remove lifetime hacks, require 'static

In theory, one can do std::mem::forget, and ignore the drop handler. With
the lifetime hack, this could result in a crash.

So we simply require 'static lifetime now (futures also needs that).
This commit is contained in:
Dietmar Maurer
2020-10-01 14:48:49 +02:00
parent df766e668f
commit a71bc08ff4
3 changed files with 10 additions and 17 deletions

View File

@ -84,7 +84,7 @@ fn verify_index_chunks(
worker: Arc<WorkerTask>,
) -> Result<(), Error> {
let errors = AtomicUsize::new(0);
let errors = Arc::new(AtomicUsize::new(0));
let start_time = Instant::now();
@ -95,7 +95,7 @@ fn verify_index_chunks(
let datastore2 = Arc::clone(&datastore);
let corrupt_chunks2 = Arc::clone(&corrupt_chunks);
let verified_chunks2 = Arc::clone(&verified_chunks);
let errors2 = &errors;
let errors2 = Arc::clone(&errors);
let decoder_pool = ParallelHandler::new(
"verify chunk decoder", 4,