-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keep ordering of deserialized maps #216
Comments
Hi, thanks, that's a nice idea to pursue. Maybe we can work together and explore whether it would be possible to make the YAML de/serialization mechanisms generic over If all fails, we can always release breaking changes as long as we're in version Long story short: Consider me interested! 😆 |
Great! I'll see if can can find some time in the next few days to make a test case and initial breaking implementation, and then we can go from there |
Just made a draft PR for an initial implementation -- there's a few things I discovered while making the change which I'd like to fix, but it will probably take me a few days to get around to. In the meantime, let me know if you have any changes or requested comments and I'll make it ready when I'm happy with the PR |
Serde's yaml deserialization supports maintaining the order of map types (at least in yaml/json, haven't looked at other formats) by using
LinkedHashMap
instead ofHashMap
. Quickly perusing throughconfig-rs
, it looks like thetable
value usesHashMap
and so will always lose the ordering of a map.AFAICT, a fix to this would be as simple as changing
HashMap
toLinkedHashMap
in the appropriate places, but since that type is exposed to the API, it could be considered a breaking change. Would the project be receptive to such a change?The text was updated successfully, but these errors were encountered: