fn sorted_iter<K, V>(map: &HashMap<K, V>) -> impl Iterator<Item = (&K, &V)>
where
    K: Ord,
{
    let mut pairs = map.iter().collect::<Vec<_>>();
    pairs.sort_by_key(|(k, _)| *k);
    pairs.into_iter()
}
/// Returns a sorted iterator over a hash map, sorted based on key.
///
/// The intention of this API is to be used whenever the iteration order of a
/// `HashMap` might affect the generated JS bindings. We want to ensure that the
/// generated output is deterministic and we do so by ensuring that iteration of
/// hash maps is consistently sorted.
Returns a sorted iterator over a hash map, sorted based on key.
The intention of this API is to be used whenever the iteration order of a
`HashMap` might affect the generated JS bindings. We want to ensure that the
generated output is deterministic and we do so by ensuring that iteration of
hash maps is consistently sorted.
Returns a sorted iterator over a hash map sorted based on key . The intention of this API is to be used whenever the iteration order of a ` HashMap ` might affect the generated JS bindings . We want to ensure that the generated output is deterministic and we do so by ensuring that iteration of hash maps is consistently sorted .
fn sorted_iter<K, V>(map: &HashMap<K, V>) -> impl Iterator<Item = (&K, &V)>
where
    K: Ord,
{
    let mut pairs = map.iter().collect::<Vec<_>>();
    pairs.sort_by_key(|(k, _)| *k);
    pairs.into_iter()
}
fn sorted_iter < K , V > ( map : & HashMap < K , V > ) -> impl Iterator < Item = ( & K , & V ) > where K : Ord , { let mut pairs = map . iter ( ) . collect :: < Vec < _ > > ( ) ; pairs . sort_by_key ( | ( k , _ ) | * k ) ; pairs . into_iter ( ) }
Returns a sorted iterator over a hash map, sorted based on key.
Returns a sorted iterator over a hash map sorted based on key .
map
&HashMap<K, V>
map
&HashMap<K, V>