Skip to content

Commit eb41d27

Browse files
Apply suggested fix to benches/read_metadata.rs from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Chris Hennick <[email protected]>
1 parent 338e63f commit eb41d27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

benches/read_metadata.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ fn generate_random_archive(count_files: usize, file_size: usize) -> ZipResult<Ve
1717
let options = SimpleFileOptions::default().compression_method(CompressionMethod::Stored);
1818

1919
let mut bytes = vec![0u8; file_size];
20+
getrandom::fill(&mut bytes)
21+
.map_err(|e| std::io::Error::other(format!("getrandom error: {}", e)))?;
2022

2123
for file_index in 0..count_files {
2224
let name =
2325
format!("file_deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef_{file_index}.dat");
2426
writer.start_file(name, options)?;
25-
getrandom::fill(&mut bytes)
26-
.map_err(|e| std::io::Error::other(format!("getrandom error: {}", e)))?;
2727
writer.write_all(&bytes)?;
2828
}
2929

0 commit comments

Comments
 (0)