From 28c57b6ce6feab07f5961f02bce88b0e3674d0b7 Mon Sep 17 00:00:00 2001 From: Luke Zaparaniuk Date: Mon, 5 Dec 2016 08:26:48 +0000 Subject: [PATCH] Fixed inaccuracies Switched the key and value types on line 44 to be correct and set the original value to the correct value on line 176 --- src/ch08-03-hash-maps.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ch08-03-hash-maps.md b/src/ch08-03-hash-maps.md index c345b6f51..77b1b8811 100644 --- a/src/ch08-03-hash-maps.md +++ b/src/ch08-03-hash-maps.md @@ -41,7 +41,7 @@ in the prelude. Hash maps also have less support from the standard library; there's no built-in macro to construct them, for example. Just like vectors, hash maps store their data on the heap. This `HashMap` has -keys of type `i32` and values of type `&str`. Like vectors, hash maps are +keys of type `&str` and values of type `i32`. Like vectors, hash maps are homogenous: all of the keys must have the same type, and all of the values must have the same type. @@ -173,7 +173,7 @@ scores.insert(String::from("Blue"), 25); println!("{:?}", scores); ``` -This will print `{"Blue": 25}`. The original value of 25 has been overwritten. +This will print `{"Blue": 25}`. The original value of 10 has been overwritten. #### Only Insert If the Key Has No Value