Use IndexMap instead of LinkedHashMap#451
Conversation
|
Is there a benchmark suite or something like that? I wonder if we could drop the other implementation. |
|
Oh, |
dtolnay
left a comment
There was a problem hiding this comment.
Thanks, I am okay with this. If anyone requires preserve_order on older versions we can have them send an indexmap PR to support an older version. It looks like that would just be removing their use of pub(crate) which seems easy.
| # Use LinkedHashMap rather than BTreeMap as the map type of serde_json::Value. | ||
| # Use IndexMap rather than BTreeMap as the map type of serde_json::Value. | ||
| # This allows data to be read into a Value and written back to a JSON string | ||
| # while preserving the order of map keys in the input. |
There was a problem hiding this comment.
Please rephrase this comment to include only the observable guarantees that we make about the behavior of serde_json with this feature enabled, and nothing about what the implementation does internally as we don't need to commit to a specific internal implementation.
| [dependencies] | ||
| serde = "1.0.60" | ||
| linked-hash-map = { version = "0.5", optional = true } | ||
| indexmap = { version = "1.0", optional = true } |
There was a problem hiding this comment.
Please change the Travis configuration to add a build at indexmap's minimum supported compiler version, and remove any preserve_order builds below that compiler version.
Use IndexMap instead of LinkedHashMap
This was surprisingly easy 😕.