diff --git a/solutions/11_hashmaps/hashmaps3.rs b/solutions/11_hashmaps/hashmaps3.rs index c075b0f6..9c58b2d3 100644 --- a/solutions/11_hashmaps/hashmaps3.rs +++ b/solutions/11_hashmaps/hashmaps3.rs @@ -28,13 +28,17 @@ fn build_scores_table(results: &str) -> HashMap<&str, TeamScores> { let team_2_score: u8 = split_iterator.next().unwrap().parse().unwrap(); // Insert the default with zeros if a team doesn't exist yet. - let team_1 = scores.entry(team_1_name).or_insert_with(TeamScores::default); + let team_1 = scores + .entry(team_1_name) + .or_insert_with(TeamScores::default); // Update the values. team_1.goals_scored += team_1_score; team_1.goals_conceded += team_2_score; // Similarely for the second team. - let team_2 = scores.entry(team_2_name).or_insert_with(TeamScores::default); + let team_2 = scores + .entry(team_2_name) + .or_insert_with(TeamScores::default); team_2.goals_scored += team_2_score; team_2.goals_conceded += team_1_score; }