From bacd90d96f5810e7d83941ec96baecd9d0c375fa Mon Sep 17 00:00:00 2001 From: Cutieguwu Date: Sat, 26 Apr 2025 16:07:32 -0400 Subject: [PATCH] Slight readability improvement by mutating `found` instead of shadowing it repeatedly in LogFile::most_frequent_action --- gamelog/src/file.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gamelog/src/file.rs b/gamelog/src/file.rs index abf4a61..ced7ca1 100644 --- a/gamelog/src/file.rs +++ b/gamelog/src/file.rs @@ -42,12 +42,14 @@ impl LogFile { .collect::>() .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;