Completed hashmaps
This commit is contained in:
@@ -8,12 +8,14 @@ use std::collections::HashMap;
|
||||
|
||||
fn fruit_basket() -> HashMap<String, u32> {
|
||||
// TODO: Declare the hash map.
|
||||
// let mut basket =
|
||||
let mut basket = HashMap::new();
|
||||
|
||||
// Two bananas are already given for you :)
|
||||
basket.insert(String::from("banana"), 2);
|
||||
|
||||
// TODO: Put more fruits in your basket.
|
||||
basket.insert(String::from("Apple"), 12);
|
||||
basket.insert(String::from("Orange"), 12);
|
||||
|
||||
basket
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user