Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Allow enum variant as hashmap key #32

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jan 22, 2015

merge after #31
closes rust-lang/rust#21470 here

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (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.

Please see CONTRIBUTING.md for more information.

@huonw
Copy link
Contributor

huonw commented Jan 22, 2015

Does this work with Decodable?

@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 22, 2015

huonw: that's how it worked before, but i'll add a test

@oli-obk oli-obk force-pushed the allow_enum_variant_as_hashmap_key branch from 9c23568 to 68acb1c Compare January 22, 2015 11:57
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 22, 2015

@huonw i changed the test to also check if deserialize still works.
actually i think rust will decode almost everything, even invalid json like {0:"hi"} without complaint. It just won't create invalid json

@alexcrichton
Copy link
Contributor

Thanks!

alexcrichton added a commit that referenced this pull request Jan 22, 2015
@alexcrichton alexcrichton merged commit 2824cdb into rust-lang-deprecated:master Jan 22, 2015
@oli-obk oli-obk deleted the allow_enum_variant_as_hashmap_key branch January 26, 2015 08:36
oli-obk pushed a commit to oli-obk/rust that referenced this pull request Jan 26, 2015
closes rust-lang#21470 on main rust repository
was fixed on rust-lang/rustc-serialize (see rust-lang-deprecated/rustc-serialize#32)
barosl added a commit to barosl/rust that referenced this pull request Jan 27, 2015
…ichton

closes rust-lang#21470 on main rust repository
was fixed on rust-lang/rustc-serialize (see rust-lang-deprecated/rustc-serialize#32)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON serialization of HashMaps with Enum keys is broken
4 participants