@@ -25,7 +25,7 @@ pub struct BenchmarkCommand {
2525 /// The path to the file(s) to benchmark. This accepts one or more:
2626 ///
2727 /// - `*.wasm` files: individual benchmarks that meet the requirements
28- /// outlined in `benchmarks/README.md`
28+ /// outlined in `benchmarks/README.md`
2929 ///
3030 /// - `*.suite` files: a file containing a newline-delimited list of
3131 /// benchmarks to execute. A `*.suite` file may contain `#`-prefixed line
@@ -180,7 +180,7 @@ impl BenchmarkCommand {
180180 log:: info!( "Using working directory: {}" , working_dir. display( ) ) ;
181181
182182 // Read the Wasm bytes.
183- let bytes = fs:: read ( & wasm_file) . context ( "Attempting to read Wasm bytes" ) ?;
183+ let bytes = fs:: read ( wasm_file) . context ( "Attempting to read Wasm bytes" ) ?;
184184 log:: debug!( "Wasm benchmark size: {} bytes" , bytes. len( ) ) ;
185185
186186 let wasm_hash = {
@@ -296,11 +296,11 @@ impl BenchmarkCommand {
296296 . with_context ( || "expected the benchmark file to have an extension" ) ?
297297 . to_str ( )
298298 . with_context ( || "expected the benchmark file to have a printable name" ) ?;
299- let mut stdout_expected = wasm_file_dir. join ( format ! ( "{}.stdout.expected" , benchmark_name ) ) ;
299+ let mut stdout_expected = wasm_file_dir. join ( format ! ( "{benchmark_name }.stdout.expected" ) ) ;
300300 if !stdout_expected. exists ( ) {
301301 stdout_expected = wasm_file_dir. join ( "default.stdout.expected" ) ;
302302 }
303- let mut stderr_expected = wasm_file_dir. join ( format ! ( "{}.stderr.expected" , benchmark_name ) ) ;
303+ let mut stderr_expected = wasm_file_dir. join ( format ! ( "{benchmark_name }.stderr.expected" ) ) ;
304304 if !stderr_expected. exists ( ) {
305305 stderr_expected = wasm_file_dir. join ( "default.stderr.expected" ) ;
306306 }
@@ -365,8 +365,7 @@ impl BenchmarkCommand {
365365 . args (
366366 self . measures
367367 . iter ( )
368- . map ( |m| [ "--measure" . to_string ( ) , m. to_string ( ) ] )
369- . flatten ( ) ,
368+ . flat_map ( |m| [ "--measure" . to_string ( ) , m. to_string ( ) ] ) ,
370369 )
371370 . arg ( "--raw" )
372371 . arg ( "--output-format" )
@@ -387,7 +386,7 @@ impl BenchmarkCommand {
387386 }
388387
389388 if let Some ( flags) = & self . engine_flags {
390- command. arg ( format ! ( "--engine-flags={}" , flags ) ) ;
389+ command. arg ( format ! ( "--engine-flags={flags}" ) ) ;
391390 }
392391
393392 command. arg ( "--" ) . arg ( & wasm) ;
@@ -500,7 +499,7 @@ pub fn check_engine_path(engine: &str) -> Result<PathBuf> {
500499/// `stderr`) is the same as the `expected` output.
501500fn compare_output_file ( wasm : & Path , actual : & Path , expected : & Path ) -> Result < ( ) > {
502501 if expected. exists ( ) {
503- let expected_data = std:: fs:: read_to_string ( & expected)
502+ let expected_data = std:: fs:: read_to_string ( expected)
504503 . with_context ( || format ! ( "failed to read `{}`" , expected. display( ) ) ) ?;
505504 let stdout_actual_data = std:: fs:: read_to_string ( actual)
506505 . with_context ( || format ! ( "failed to read `{}`" , actual. display( ) ) ) ?;
@@ -540,7 +539,7 @@ mod tests {
540539 display_summaries ( & measurements, & mut output) ?;
541540
542541 let actual = String :: from_utf8 ( output) ?;
543- eprintln ! ( "=== Actual ===\n {}" , actual ) ;
542+ eprintln ! ( "=== Actual ===\n {actual}" ) ;
544543
545544 let expected = r#"
546545compilation
@@ -574,7 +573,7 @@ execution
574573 [3556483 3729210.70 4349778] /tmp/old_backend_2.so
575574 [3639688 4025470.30 5782529] /tmp/old_backend_3.so
576575"# ;
577- eprintln ! ( "=== Expected ===\n {}" , expected ) ;
576+ eprintln ! ( "=== Expected ===\n {expected}" ) ;
578577
579578 assert_eq ! ( actual. trim( ) , expected. trim( ) ) ;
580579 Ok ( ( ) )
@@ -589,7 +588,7 @@ execution
589588 display_effect_size ( & measurements, 0.05 , & mut output) ?;
590589
591590 let actual = String :: from_utf8 ( output) ?;
592- eprintln ! ( "=== Actual ===\n {}" , actual ) ;
591+ eprintln ! ( "=== Actual ===\n {actual}" ) ;
593592
594593 let expected = r#"
595594compilation :: cycles :: benchmarks/pulldown-cmark/benchmark.wasm
@@ -642,7 +641,7 @@ instantiation :: nanoseconds :: benchmarks/pulldown-cmark/benchmark.wasm
642641 [65929 71540.70 112190] new_backend.so
643642 [61849 69023.59 115015] old_backend.so
644643"# ;
645- eprintln ! ( "=== Expected ===\n {}" , expected ) ;
644+ eprintln ! ( "=== Expected ===\n {expected}" ) ;
646645
647646 assert_eq ! ( actual. trim( ) , expected. trim( ) ) ;
648647 Ok ( ( ) )
0 commit comments