@@ -7,26 +7,29 @@ use crate::template::{all_days, readme_benchmarks, Day};
77pub fn handle ( day : Option < Day > , recreate_all : bool ) {
88 let stored_timings = Timings :: read_from_file ( ) ;
99
10- let days_to_run = day. map ( |day| HashSet :: from ( [ day] ) ) . unwrap_or_else ( || {
11- if recreate_all {
12- all_days ( ) . collect ( )
13- } else {
14- // when the `--all` flag is not set, filter out days that are fully benched.
15- all_days ( )
16- . filter ( |day| !stored_timings. is_day_complete ( day) )
17- . collect ( )
18- }
19- } ) ;
10+ let days_to_run = day. map_or_else (
11+ || {
12+ if recreate_all {
13+ all_days ( ) . collect ( )
14+ } else {
15+ // when the `--all` flag is not set, filter out days that are fully benched.
16+ all_days ( )
17+ . filter ( |day| !stored_timings. is_day_complete ( * day) )
18+ . collect ( )
19+ }
20+ } ,
21+ |day| HashSet :: from ( [ day] ) ,
22+ ) ;
2023
21- let timings = run_multi ( days_to_run, true , true ) . unwrap ( ) ;
24+ let timings = run_multi ( & days_to_run, true , true ) . unwrap ( ) ;
2225
2326 let merged_timings = stored_timings. merge ( & timings) ;
2427 merged_timings. store_file ( ) . unwrap ( ) ;
2528
2629 println ! ( ) ;
2730 match readme_benchmarks:: update ( merged_timings) {
2831 Ok ( ( ) ) => {
29- println ! ( "Stored updated benchmarks." )
32+ println ! ( "Stored updated benchmarks." ) ;
3033 }
3134 Err ( _) => {
3235 eprintln ! ( "Failed to store updated benchmarks." ) ;
0 commit comments