fix(review): address review feedback
Co-authored-by: Tristan Guichaoua <33934311+tguichaoua@users.noreply.github.com>
This commit is contained in:
parent
00435287c9
commit
c4b176de50
1 changed files with 7 additions and 14 deletions
|
@ -7,21 +7,14 @@ use crate::template::{all_days, readme_benchmarks, Day};
|
|||
pub fn handle(day: Option<Day>, recreate_all: bool) {
|
||||
let stored_timings = Timings::read_from_file();
|
||||
|
||||
let mut days_to_run = HashSet::new();
|
||||
|
||||
match day {
|
||||
Some(day) => {
|
||||
days_to_run.insert(day);
|
||||
}
|
||||
None => {
|
||||
all_days().for_each(|day| {
|
||||
let days_to_run = day.map(|day| HashSet::from([day])).unwrap_or_else(|| {
|
||||
if recreate_all {
|
||||
all_days().collect()
|
||||
} else {
|
||||
// when the `--all` flag is not set, filter out days that are fully benched.
|
||||
if recreate_all || !stored_timings.is_day_complete(&day) {
|
||||
days_to_run.insert(day);
|
||||
all_days().filter(|day| !stored_timings.is_day_complete(&day)).collect()
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
let timings = run_multi(days_to_run, true, true).unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue