Challenge 2: A Product Price HashMap — Possible Solution ==================================================================== use std::collections::HashMap; fn main() { let mut prices: HashMap = HashMap::new(); prices.insert(String::from("Mouse"), 24.99); prices.insert(String::from("Keyboard"), 59.99); prices.insert(String::from("Monitor"), 199.99); match prices.get("Keyboard") { Some(price) => println!("Keyboard: ${}", price), None => println!("Keyboard not found"), } match prices.get("Webcam") { Some(price) => println!("Webcam: ${}", price), None => println!("Webcam not found"), } } WHY THIS WORKS AS AN ANSWER ------------------------------ Three insert() calls populate the HashMap with the required product-name-to-price mappings, matching this chapter's own HashMap example pattern. prices.get("Keyboard") returns Some(&59.99) since that key exists — the match's Some(price) arm extracts and prints it directly. prices.get("Webcam") returns None since that key was never inserted — handled by the match's None arm rather than causing any error or panic. Because get() returns Option<&V> (per this chapter), there is no way to accidentally treat a missing key as if it held a real price — both outcomes must be explicitly handled, exactly the same discipline Chapter 6's Option enforced everywhere else.