Fix broken benchmark

This commit is contained in:
Jack Fletcher 2021-06-06 22:33:46 +01:00
parent 7edf2489d5
commit 4a7c0d4e5c

View file

@ -13,8 +13,11 @@ fn generate_random_archive(size: usize) -> Vec<u8> {
zip::write::FileOptions::default().compression_method(zip::CompressionMethod::Stored);
writer.start_file("random.dat", options).unwrap();
// Generate some random data.
let mut bytes = vec![0u8; size];
rand::thread_rng().fill_bytes(&mut bytes);
rand::thread_rng().fill(bytes.as_mut_slice());
writer.write_all(&bytes).unwrap();
writer.finish().unwrap().into_inner()