Skip to content
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

support char as map key #626

Open
dhardy opened this issue Oct 21, 2023 · 1 comment
Open

support char as map key #626

dhardy opened this issue Oct 21, 2023 · 1 comment
Labels
A-serde Area: Serde integration

Comments

@dhardy
Copy link

dhardy commented Oct 21, 2023

When attempting to use an untagged enum over a char as a map key while serializing to TOML I see this error: map key was not a string.

Writing my own serializer which uses char::encode_utf8 lets me work around this, but I think TOML should directly support a char as a map key?

Presumably this is just a little code in KeySerializer's fn serialize_char, maybe also the deserializer.

@epage epage added the A-serde Area: Serde integration label Oct 23, 2023
@epage
Copy link
Member

epage commented Oct 23, 2023

The approach I've been taking is that we do whatever serde_json does.

Please follow the pattern in #586 by including a complete reproduction case that contrasts tomls behavior with serde_json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-serde Area: Serde integration
Projects
None yet
Development

No branches or pull requests

2 participants