let mut game_preparatory = || { let mut individual_scores = hashmap::new(); for player in team_members.iter() { individual_scores.entry(player.to_string()).or_insert(0); } let reset_scores = || { for score in individual_scores.values_mut() { *score = 0; } println!("scores reset to zero, a fresh start for each individual!"); }; let query_scores = |player: &str| -> option<&i32> { individual_scores.get(player) }; if individual_scores.keys().len() > 0 { println!("preparatory phase completed, ready to disown any past shortcomings and focus on the game!"); } reset_scores(); query_scores("john doe"); };