diff options
| author | mo8it <mo8it@proton.me> | 2024-06-26 01:52:33 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-06-26 01:52:33 +0200 |
| commit | f1bd4447924e797e8fb0012f6bc47a507438f3f5 (patch) | |
| tree | 9a2e3ebb04bce9fe83dfa0658c41ac289658bd5d /rustlings-macros/info.toml | |
| parent | fbc226a51043f7c9be4c414292d37d3ce97038fe (diff) | |
hashmaps3 solution
Diffstat (limited to 'rustlings-macros/info.toml')
| -rw-r--r-- | rustlings-macros/info.toml | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/rustlings-macros/info.toml b/rustlings-macros/info.toml index 0da573b..c5ce847 100644 --- a/rustlings-macros/info.toml +++ b/rustlings-macros/info.toml @@ -574,16 +574,18 @@ https://doc.rust-lang.org/stable/book/ch08-03-hash-maps.html#only-inserting-a-va name = "hashmaps3" dir = "11_hashmaps" hint = """ -Hint 1: Use the `entry()` and `or_insert()` methods of `HashMap` to insert - entries corresponding to each team in the scores table. +Hint 1: Use the `entry()` and `or_insert()` (or `or_insert_with()`) methods of + `HashMap` to insert the default value of `Team` if a team doesn't + exist in the table yet. -Learn more at https://doc.rust-lang.org/stable/book/ch08-03-hash-maps.html#only-inserting-a-value-if-the-key-has-no-value +Learn more in The Book: +https://doc.rust-lang.org/stable/book/ch08-03-hash-maps.html#only-inserting-a-value-if-the-key-has-no-value Hint 2: If there is already an entry for a given key, the value returned by `entry()` can be updated based on the existing value. -Learn more at https://doc.rust-lang.org/book/ch08-03-hash-maps.html#updating-a-value-based-on-the-old-value -""" +Learn more in The Book: +https://doc.rust-lang.org/book/ch08-03-hash-maps.html#updating-a-value-based-on-the-old-value""" # QUIZ 2 |
