Skip to content

Commit 5687676

Browse files
docs:clarify instructions on hashmaps2.rs
1 parent 9acefe8 commit 5687676

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

exercises/hashmaps/hashmaps2.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// hashmaps2.rs
2-
32
// A basket of fruits in the form of a hash map is given. The key
43
// represents the name of the fruit and the value represents how many
5-
// of that particular fruit is in the basket. You have to put *MORE
6-
// THAN 11* fruits in the basket. Three types of fruits - Apple (4),
7-
// Mango (2) and Lychee (5) are already given in the basket. You are
8-
// not allowed to insert any more of these fruits!
4+
// of that particular fruit is in the basket.
5+
// Three types of fruits - Apple (4), Mango (2) and Lychee (5) are already given in the basket.
6+
// You must add fruit to the basket so that there is at least
7+
// one of each kind and more than 11 in total.
8+
// You are not allowed to insert any more of these fruits!
99
//
1010
// Make me pass the tests!
1111
//
@@ -34,8 +34,8 @@ fn fruit_basket(basket: &mut HashMap<Fruit, u32>) {
3434
];
3535

3636
for fruit in fruit_kinds {
37-
// TODO: Put new fruits if not already present. Note that you
38-
// are not allowed to put any type of fruit that's already
37+
// TODO: Insert new fruits if they are not already present in the basket.
38+
// Note that you are not allowed to put any type of fruit that's already
3939
// present!
4040
}
4141
}
@@ -44,6 +44,7 @@ fn fruit_basket(basket: &mut HashMap<Fruit, u32>) {
4444
mod tests {
4545
use super::*;
4646

47+
// Don't modify this function!
4748
fn get_fruit_basket() -> HashMap<Fruit, u32> {
4849
let mut basket = HashMap::<Fruit, u32>::new();
4950
basket.insert(Fruit::Apple, 4);

0 commit comments

Comments
 (0)