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) {
|
pub fn handle(day: Option<Day>, recreate_all: bool) {
|
||||||
let stored_timings = Timings::read_from_file();
|
let stored_timings = Timings::read_from_file();
|
||||||
|
|
||||||
let mut days_to_run = HashSet::new();
|
let days_to_run = day.map(|day| HashSet::from([day])).unwrap_or_else(|| {
|
||||||
|
if recreate_all {
|
||||||
match day {
|
all_days().collect()
|
||||||
Some(day) => {
|
} else {
|
||||||
days_to_run.insert(day);
|
// when the `--all` flag is not set, filter out days that are fully benched.
|
||||||
|
all_days().filter(|day| !stored_timings.is_day_complete(&day)).collect()
|
||||||
}
|
}
|
||||||
None => {
|
});
|
||||||
all_days().for_each(|day| {
|
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let timings = run_multi(days_to_run, true, true).unwrap();
|
let timings = run_multi(days_to_run, true, true).unwrap();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue