mirror of
https://git.aramjonghu.dev/AramJonghu/rustlings.git
synced 2026-09-05 01:33:30 +02:00
feat(section): hashmap + section complete w/ quiz2
This commit is contained in:
@@ -27,6 +27,11 @@ fn build_scores_table(results: &str) -> HashMap<&str, TeamScores> {
|
||||
let team_1_score: u8 = split_iterator.next().unwrap().parse().unwrap();
|
||||
let team_2_score: u8 = split_iterator.next().unwrap().parse().unwrap();
|
||||
|
||||
scores.entry(team_1_name).or_default().goals_scored += team_1_score;
|
||||
scores.entry(team_2_name).or_default().goals_scored += team_2_score;
|
||||
|
||||
scores.entry(team_1_name).or_default().goals_conceded += team_2_score;
|
||||
scores.entry(team_2_name).or_default().goals_conceded += team_1_score;
|
||||
// TODO: Populate the scores table with the extracted details.
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user