From 0fcfd332dd5057a590371c28ed3e6b267f788b76 Mon Sep 17 00:00:00 2001 From: Hunter Kvalevog Date: Sun, 27 Sep 2026 11:08:08 -0500 Subject: rustlings: complete 11 --- rustlings/exercises/11_hashmaps/hashmaps3.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'rustlings/exercises/11_hashmaps/hashmaps3.rs') diff --git a/rustlings/exercises/11_hashmaps/hashmaps3.rs b/rustlings/exercises/11_hashmaps/hashmaps3.rs index 5b390ab..0fa4a6b 100644 --- a/rustlings/exercises/11_hashmaps/hashmaps3.rs +++ b/rustlings/exercises/11_hashmaps/hashmaps3.rs @@ -31,6 +31,13 @@ fn build_scores_table(results: &str) -> HashMap<&str, TeamScores> { // Keep in mind that goals scored by team 1 will be the number of goals // conceded by team 2. Similarly, goals scored by team 2 will be the // number of goals conceded by team 1. + let team_1 = scores.entry(team_1_name).or_default(); + team_1.goals_scored += team_1_score; + team_1.goals_conceded += team_2_score; + let team_2 = scores.entry(team_2_name).or_default(); + team_2.goals_scored += team_2_score; + team_2.goals_conceded += team_1_score; + } scores -- cgit v1.2.3