-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: use serde for de/serializing GuildId #206
Conversation
Funny thing, disregarding the fact Serde deserializes to numbers (shown below), the tests pass, and config loads lol [guilds.420]
tournaments_watcher_channel_id = "69"
[guilds.69]
tournaments_watcher_channel_id = "2137" |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #206 +/- ##
==========================================
+ Coverage 43.56% 45.38% +1.82%
==========================================
Files 22 22
Lines 1398 1430 +32
==========================================
+ Hits 609 649 +40
+ Misses 789 781 -8
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Actually, digits are valid keys for TOML tables/dictionaries:
toml-rs seems to support only |
66e1f07
to
ee38171
Compare
It just works ™️ |
Thanks for the nice simplification! |
Serde is smart and can handle a lot of de/serializing magic. This PR aims to reduce extraneous manual implementations in favor of Serde's existing functionality.
I know deserializing works in this case (Serde is fully capable of taking a
String
as input and going through multiple transformations ofString -> u64 -> GuildId
); however, I need to do more testing for serializing (some additional Serde magic might be needed to force it to serialize toString
, nothing though that Serde shouldn't be capable of); therefore, this PR is in draft mode for now.