Closed edwardycl closed 2 weeks ago
Now that I think about it, since the type of key is fixed to String
, IndexMap
can also be hashed by sorting its key-value in a consistent order. It doesn't break the Eq
-Hash
relationship, and we can implement Hash
regardless of the "preserve_order" feature. What do you think?
IndexMap
is the only type that is used withinValue
that does not implementHash
, and it is by design: https://github.com/indexmap-rs/indexmap/issues/288#issuecomment-1804735361If "preserve_order" feature is not set,
Value::Object
usesBTreeMap
instead ofIndexMap
so it is possible to auto-implHash
forValue
.