msgpack-rust
msgpack-rust copied to clipboard
Convert Value to HashMap
Is support for Value::as_hash_map -> Option<HashMap<EqValue, Value>> planned?
Currently it's not easy to convert a Vec<(Value, Value)> to a HashMap because Value is not Eq.
No, it's not possible, because Value may be f32/f64, which are not Eq.
Yes, but a way how this could be done is by creating a "subtype" of Value that does not include f32/f64. Value::as_hash_map would then simply fail if a key is a float.