File tree 1 file changed +23
-22
lines changed 1 file changed +23
-22
lines changed Original file line number Diff line number Diff line change @@ -10,28 +10,29 @@ use super::{
10
10
pub fn run_multi ( days_to_run : & HashSet < Day > , is_release : bool , is_timed : bool ) -> Option < Timings > {
11
11
let mut timings: Vec < Timing > = Vec :: with_capacity ( days_to_run. len ( ) ) ;
12
12
13
- all_days ( ) . for_each ( |day| {
14
- if day > 1 {
15
- println ! ( ) ;
16
- }
17
-
18
- println ! ( "{ANSI_BOLD}Day {day}{ANSI_RESET}" ) ;
19
- println ! ( "------" ) ;
20
-
21
- if !days_to_run. contains ( & day) {
22
- println ! ( "Skipped." ) ;
23
- return ;
24
- }
25
-
26
- let output = child_commands:: run_solution ( day, is_timed, is_release) . unwrap ( ) ;
27
-
28
- if output. is_empty ( ) {
29
- println ! ( "Not solved." ) ;
30
- } else {
31
- let val = child_commands:: parse_exec_time ( & output, day) ;
32
- timings. push ( val) ;
33
- }
34
- } ) ;
13
+ let mut need_space = false ;
14
+
15
+ // NOTE: use non-duplicate, sorted day values.
16
+ all_days ( )
17
+ . filter ( |day| days_to_run. contains ( day) )
18
+ . for_each ( |day| {
19
+ if need_space {
20
+ println ! ( ) ;
21
+ }
22
+ need_space = true ;
23
+
24
+ println ! ( "{ANSI_BOLD}Day {day}{ANSI_RESET}" ) ;
25
+ println ! ( "------" ) ;
26
+
27
+ let output = child_commands:: run_solution ( day, is_timed, is_release) . unwrap ( ) ;
28
+
29
+ if output. is_empty ( ) {
30
+ println ! ( "Not solved." ) ;
31
+ } else {
32
+ let val = child_commands:: parse_exec_time ( & output, day) ;
33
+ timings. push ( val) ;
34
+ }
35
+ } ) ;
35
36
36
37
if is_timed {
37
38
let timings = Timings { data : timings } ;
You can’t perform that action at this time.
0 commit comments