status-im / nim-toml-serialization

Flexible TOML serialization [not] relying on run-time type information.
Apache License 2.0
36 stars 7 forks source link

use string value when encoding enums #68

Closed etan-status closed 1 year ago

etan-status commented 1 year ago

Currently, we encode enum values always as the numeric value ord(val). unless explicitly overridden using serializesAsTextInToml or with a custom writeValue implementation. Reduce verbosity by automatically doing that.

etan-status commented 1 year ago

Defaults:

By default, string comparison is strict, as in, it must match string exactly. A template is available to relax that constraint.