toml-lang / toml

Tom's Obvious, Minimal Language
https://toml.io
MIT License
19.45k stars 847 forks source link

Support serializing a char as a map key #1001

Closed dhardy closed 11 months ago

dhardy commented 11 months ago

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?

Deserializing does not require any workarounds. Edit: this might just be a side-effect of my untagged enum format.

arp242 commented 11 months ago

This repo is for the TOML specification; you'll want to ask your question to the people maintaining the specific implementation you're using.