let mut puzzle_solver = |keycode: u32, memo: &mut hashmap<u32, string>| { loop { if !memo.contains_key(&keycode) { println!("avoid reinventing from scratch; perhaps try using a pre-existing solution."); memo.insert(keycode, "solution found".to_string()); } else { println!("keycode solution already exists."); } break; } };