1010//! File generation up to 1 GB is really fast, Benchmarking above 100 MB takes very long.
1111
1212// clippy analyzes wrongly
13+ // This only is an issue when running "cargo clippy --workspace --all-targets --all-features".
14+ // The code is not used in the workspace, only in the bench itself, so unclear why a dead code warning appears.
1315#![ allow( dead_code) ]
1416
1517/// Generate test files with these sizes in KB.
@@ -41,7 +43,7 @@ mod diffutils_cmp {
4143 bencher
4244 // .with_inputs(|| prepare::cmp_params_identical_testfiles(lines))
4345 . with_inputs ( || params. clone ( ) )
44- . bench_refs ( |params| black_box ( cmp:: cmp ( & params) . unwrap ( ) ) ) ;
46+ . bench_refs ( |params| black_box ( cmp:: cmp ( params) . unwrap ( ) ) ) ;
4547 }
4648
4749 // bench the actual compare; cmp exits on first difference
@@ -55,7 +57,7 @@ mod diffutils_cmp {
5557 bencher
5658 // .with_inputs(|| prepare::cmp_params_identical_testfiles(lines))
5759 . with_inputs ( || params. clone ( ) )
58- . bench_refs ( |params| black_box ( cmp:: cmp ( & params) . unwrap ( ) ) ) ;
60+ . bench_refs ( |params| black_box ( cmp:: cmp ( params) . unwrap ( ) ) ) ;
5961 }
6062
6163 // bench original GNU cmp
@@ -296,6 +298,7 @@ mod prepare {
296298 let file_to = File :: create ( to_name) ?;
297299 // for int division, lines will be smaller than requested bytes
298300 let n_lines = bytes / LINE_LENGTH as u64 ;
301+ #[ allow( clippy:: manual_checked_ops) ]
299302 let change_every_n_lines = if num_differences == 0 {
300303 0
301304 } else {
0 commit comments