From 0e090ae11244ee8e0cdb50501b34c36a7112fd0c Mon Sep 17 00:00:00 2001 From: mo8it Date: Thu, 17 Oct 2024 14:48:56 +0200 Subject: [PATCH] Add required type annotation --- exercises/11_hashmaps/hashmaps3.rs | 2 +- solutions/11_hashmaps/hashmaps3.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/11_hashmaps/hashmaps3.rs b/exercises/11_hashmaps/hashmaps3.rs index 7e9584d1..5b390ab9 100644 --- a/exercises/11_hashmaps/hashmaps3.rs +++ b/exercises/11_hashmaps/hashmaps3.rs @@ -17,7 +17,7 @@ struct TeamScores { fn build_scores_table(results: &str) -> HashMap<&str, TeamScores> { // The name of the team is the key and its associated struct is the value. - let mut scores = HashMap::new(); + let mut scores = HashMap::<&str, TeamScores>::new(); for line in results.lines() { let mut split_iterator = line.split(','); diff --git a/solutions/11_hashmaps/hashmaps3.rs b/solutions/11_hashmaps/hashmaps3.rs index 41da784b..433b16c3 100644 --- a/solutions/11_hashmaps/hashmaps3.rs +++ b/solutions/11_hashmaps/hashmaps3.rs @@ -17,7 +17,7 @@ struct TeamScores { fn build_scores_table(results: &str) -> HashMap<&str, TeamScores> { // The name of the team is the key and its associated struct is the value. - let mut scores = HashMap::new(); + let mut scores = HashMap::<&str, TeamScores>::new(); for line in results.lines() { let mut split_iterator = line.split(',');