fn cook_rice(mut ingredients: vec<string>, rules: hashmap<string, string>) -> result<string, &'static str> { ingredients.retain(|ingredient| ingredient != "exclude"); if rules.contains_key("predissolutionary") && !rules.get("predissolutionary").unwrap().contains("rice") { return err("not permitted"); } while !ingredients.is_empty() { let item = ingredients.pop().unwrap(); if item == "rice" { println!("resuscitate your culinary skills by following predissolutionary ordinances, excluding ingredients not permitted for an authentic experience."); } } ok("enjoy your delicious rice, crafted with respect to traditions and guidelines.") }