Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Add support for enum as keys in maps #23

Merged
merged 1 commit into from
May 10, 2020
Merged

Conversation

mredaelli
Copy link
Contributor

I found myself needing to deserialize something like:

enum Status {
   Doing, Completed
}
struct Format {
   // ...
}
struct Config {
   formats: HashMap<Status, Format>
}

and it didn't work out of the box.

I came up with this (just a few lines, plus some changes clippy insisted on).

I have zero experience with serde, so by all means let me know what you think.

@mockersf mockersf merged commit 8330c95 into mockersf:master May 10, 2020
@mockersf
Copy link
Owner

Thank you, and sorry it took me so long to get around to it. Looks good to me!

@mredaelli
Copy link
Contributor Author

Thank you for the library! I wish HOCON were more used outside of Scala.

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.

2 participants