-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use enums instead of string constants
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.
- Loading branch information
1 parent
be9589d
commit f495443
Showing
4 changed files
with
167 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters