diff --git a/benches/crypto_read.rs b/benches/crypto_read.rs index c04e9d0..885178c 100644 --- a/benches/crypto_read.rs +++ b/benches/crypto_read.rs @@ -28,7 +28,8 @@ fn bench_read_1mb_chacha_file(c: &mut Criterion) { let mut file = file.try_clone().unwrap(); file.seek(io::SeekFrom::Start(0)).unwrap(); let mut reader = crypto::create_read(file, cipher, &key); - black_box(io::copy(&mut reader, &mut io::sink()).unwrap()) + black_box(&reader); + io::copy(&mut reader, &mut io::sink()).unwrap(); }) }); } @@ -49,7 +50,8 @@ fn bench_read_1mb_aes_file(c: &mut Criterion) { rand::thread_rng().fill_bytes(cursor_random.get_mut()); cursor_random.seek(io::SeekFrom::Start(0)).unwrap(); io::copy(&mut cursor_random, &mut writer).unwrap(); - black_box(writer.finish().unwrap()) + black_box(&writer); + writer.finish().unwrap(); }) }); } @@ -75,7 +77,8 @@ fn bench_read_1mb_chacha_ram(c: &mut Criterion) { let mut cursor = cursor_write.clone(); cursor.seek(io::SeekFrom::Start(0)).unwrap(); let mut reader = crypto::create_read(cursor, cipher, &key); - black_box(io::copy(&mut reader, &mut io::sink()).unwrap()) + black_box(&reader); + io::copy(&mut reader, &mut io::sink()).unwrap(); }) }); } @@ -101,7 +104,8 @@ fn bench_read_1mb_aes_ram(c: &mut Criterion) { let mut cursor = cursor_write.clone(); cursor.seek(io::SeekFrom::Start(0)).unwrap(); let mut reader = crypto::create_read(cursor, cipher, &key); - black_box(io::copy(&mut reader, &mut io::sink()).unwrap()) + black_box(&reader); + io::copy(&mut reader, &mut io::sink()).unwrap(); }) }); }