-
Notifications
You must be signed in to change notification settings - Fork 60
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
Serde support #48
Serde support #48
Conversation
Thanks for the pull request, and welcome! The contain-rs team is excited to review your changes, and you should hear from @reem (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. |
@@ -16,4 +16,10 @@ keywords = ["data-structures"] | |||
readme = "README.md" | |||
|
|||
[features] | |||
nightly = [] | |||
nightly = ["serde"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the nightly
feature shouldn't enable serde
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Travis stuff should probably be changed to something like - rust: beta
env: FEATURES="serde"
- rust: nightly
env: FEATURES="nightly serde"
script:
- cargo build --features $FEATURES
- cargo test --features $FEATURES
- cargo doc --no-deps --features $FEATURES |
There are some other options if this is going to cause too much complexity to put here. I could keep the impls here (untested) and move the tests into the Serde repo, or move both the impls and the tests into Serde. I understand if you want to keep this project minimal. |
What if you do something like was done in contain-rs/vec-map#15 and add a Cargo feature that enables both |
Done. I don't like "eders" because |
Excellent. If you can squash the commits, this should be good to merge. |
Done. Thanks for the quick review. |
Serde[1] is a serialization framework that converts Rust data structures to and from a variety of formats: JSON, YAML, TOML, XML, MessagePack, Bincode. This commit adds two impls that allow Serde to serialize and deserialize a LinkedHashMap with any data format supported by Serde. I have put the impls behind a feature to avoid an unwanted dependency for people not using Serde. LinkedHashMap will be valuable to users who need to read a JSON document and preserve the order of keys in a map, or write a JSON document and control the order of map keys in the output. [1]: https://github.com/serde-rs/serde
Serde is a serialization framework that converts Rust data structures to and from a variety of formats: JSON, YAML, TOML, XML, MessagePack, Bincode.
This commit adds two impls that allow Serde to serialize and deserialize a LinkedHashMap with any data format supported by Serde. I have put the impls behind a feature to avoid an unwanted dependency for people not using Serde.
LinkedHashMap will be valuable to users who need to read a JSON document and preserve the order of keys in a map, or write a JSON document and control the order of map keys in the output.