I have a HashMap and need to get the first element:
type VarIdx = std::collections::HashMap;
fn get_first_elem(idx: VarIdx) ->
HashMap::iter returns an iterator over (&Key, &Value) pairs. What you want is HashMap::values, which produces an iterator that only produces the values of the HashMap.
Note that the order of the values is random. It has nothing to do with the order you put the values in or with the actual value of the values.