Previously, we used String<_> to represent string constants in some responses. This has multiple drawbacks:
It is error-prone because the value is not validated.
Construction is fallible because of the fixed length of the string.
The length needs to be bumped if longer values are added.
This patch introduces enums to replace these constants. As cbor_smol serializes enums using the variant index instead of the string, we need to manually implement the string conversion.
Previously, we used
String<_>
to represent string constants in some responses. This has multiple drawbacks:This patch introduces enums to replace these constants. As
cbor_smol
serializes enums using the variant index instead of the string, we need to manually implement the string conversion.