mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-02-02 23:38:41 +08:00
Fix a pesky type error
``` error[E0308]: mismatched types --> src/ch08-03-hash-maps.md:44:15 | 44 | keys of type `&str` and values of type `i32`. Like vectors, hash maps are | ^ expected struct `std::string::String`, found &str | = note: to fix, merge this pull request ```
This commit is contained in:
parent
2d32840aae
commit
ba7b12f2b0
@ -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 `&str` and values of type `i32`. Like vectors, hash maps are
|
||||
keys of type `String` and values of type `i32`. Like vectors, hash maps are
|
||||
homogeneous: all of the keys must have the same type, and all of the values must
|
||||
have the same type.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user