Completed hashmaps

This commit is contained in:
2026-01-09 17:18:22 +01:00
parent 56f173c53b
commit f3b42e5620
7 changed files with 246 additions and 12 deletions

View File

@@ -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
}