Skip to content

Commit 0e090ae

Browse files
committed
Add required type annotation
1 parent 9949670 commit 0e090ae

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

exercises/11_hashmaps/hashmaps3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct TeamScores {
1717

1818
fn build_scores_table(results: &str) -> HashMap<&str, TeamScores> {
1919
// The name of the team is the key and its associated struct is the value.
20-
let mut scores = HashMap::new();
20+
let mut scores = HashMap::<&str, TeamScores>::new();
2121

2222
for line in results.lines() {
2323
let mut split_iterator = line.split(',');

solutions/11_hashmaps/hashmaps3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct TeamScores {
1717

1818
fn build_scores_table(results: &str) -> HashMap<&str, TeamScores> {
1919
// The name of the team is the key and its associated struct is the value.
20-
let mut scores = HashMap::new();
20+
let mut scores = HashMap::<&str, TeamScores>::new();
2121

2222
for line in results.lines() {
2323
let mut split_iterator = line.split(',');

0 commit comments

Comments
 (0)