(map: HashMap<K, V>)
| 4331 | } |
| 4332 | |
| 4333 | fn serialize_hashmap<K, V>(map: HashMap<K, V>) -> Vec<(K, V)> |
| 4334 | where |
| 4335 | K: Ord + Copy, |
| 4336 | { |
| 4337 | let mut vec: Vec<_> = map.into_iter().collect(); |
| 4338 | vec.sort_by_key(|(k, _)| *k); |
| 4339 | vec |
| 4340 | } |
| 4341 | |
| 4342 | /// Methods which aren't supposed to be imported in Python. |
| 4343 | impl Context { |