In python its done this way:

```
>>> x = {1: 2, 3: 4, 4: 3, 2: 1, 0: 0}
>>> {k: v for k, v in sorted(x.items(), key=lambda item: item[1])}

{0: 0, 2: 1, 1: 2, 4: 3, 3: 4}

```

How to sort a `HashMap` by values in rust?

My code so far:

```
use std::collections::HashMap;

fn main() {
    let mut count: HashMap<String, u32>= HashMap::new();
    count.insert(String::from("A"), 5);
    count.insert(String::from("B"), 2);
    count.insert(String::from("C"), 11);
    count.insert(String::from("D"), 10);

    let highest = count.iter().max_by(|a, b| a.1.cmp(&b.1)).unwrap();

    println!("largest hash: {:?}", highest); // largest hash: ("C", 11)
}

```