summaryrefslogtreecommitdiff
path: root/solutions/11_hashmaps
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-07-04 13:38:35 +0200
committermo8it <mo8it@proton.me>2024-07-04 13:38:35 +0200
commitb87aa986345cd80bc44c7fe7bffeb72f5fe0ddb5 (patch)
treeb9f2400168cfba69cb3f0914e337df2436843023 /solutions/11_hashmaps
parenta4c07ca948dd57c71fe1894d05308af03304dec8 (diff)
Fix warnings
Diffstat (limited to 'solutions/11_hashmaps')
-rw-r--r--solutions/11_hashmaps/hashmaps3.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/solutions/11_hashmaps/hashmaps3.rs b/solutions/11_hashmaps/hashmaps3.rs
index f4059bb..54f480b 100644
--- a/solutions/11_hashmaps/hashmaps3.rs
+++ b/solutions/11_hashmaps/hashmaps3.rs
@@ -28,13 +28,13 @@ fn build_scores_table(results: &str) -> HashMap<&str, Team> {
let team_2_score: u8 = split_iterator.next().unwrap().parse().unwrap();
// Insert the default with zeros if a team doesn't exist yet.
- let mut team_1 = scores.entry(team_1_name).or_insert_with(|| Team::default());
+ let team_1 = scores.entry(team_1_name).or_insert_with(Team::default);
// Update the values.
team_1.goals_scored += team_1_score;
team_1.goals_conceded += team_2_score;
// Similarely for the second team.
- let mut team_2 = scores.entry(team_2_name).or_insert_with(|| Team::default());
+ let team_2 = scores.entry(team_2_name).or_insert_with(Team::default);
team_2.goals_scored += team_2_score;
team_2.goals_conceded += team_1_score;
}