Slight readability improvement by mutating found instead of shadowing

it repeatedly in LogFile::most_frequent_action
This commit is contained in:
Cutieguwu
2025-04-26 16:07:32 -04:00
parent ce89752009
commit bacd90d96f

View File

@@ -42,12 +42,14 @@ impl LogFile {
.collect::<Vec<Action>>()
.into_iter();
let mut found: usize;
for action in Action::iter() {
if action == Action::Unknown {
continue;
}
let found: usize = team_actions.clone().filter(|a| *a == action).count();
found = team_actions.clone().filter(|a| *a == action).count();
if found > frequency {
frequency = found;