Hi.
Please try the following code on the playground and hit "run" successively.
In stdout you'll get rstu some times, and xyzu some other times.
I expected it to return rstu every time.
This is concerning. Any advice and explanations are appreciated. Thank you.
use std::collections::HashMap;
fn main() {
let mut hm:HashMap<&str,Vec<&str>> = HashMap::new();
hm.insert("a",vec!["r","s","t"]);
hm.insert("b",vec!["x","y","z"]);
let mut hm_iter = hm.into_iter();
let entry1:(&str,Vec<&str>) = hm_iter.next().unwrap();
let entry2:(&str,Vec<&str>) = hm_iter.next().unwrap();
let mut vec_entry1 = entry1.1;
vec_entry1.push("u");
for e in vec_entry1 {println!("{e}");}
}