UnknownDecodable for most enums, plus a special case for color. - #39
Merged
JacobHearst merged 3 commits intoAug 27, 2026
Merged
Conversation
seansfkelley
marked this pull request as ready for review
August 25, 2026 00:06
JacobHearst
approved these changes
Aug 27, 2026
Owner
I think the extra coverage is worth it. I've been wondering about adding a macro to handle this automatically but not sure how folks feel about macro adoption. It would be nice to get rid of the rather silly |
Owner
|
Unit tests are failing because of rate-limiting, looks like my quick-n-dirty rate limiter isn't working quite right but that's something I'll have to figure out later, no reason to block this PR. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on top of #38 cause I'm not sure if you want this change. After the breakage fixed in that PR I thought it would be prudent to future-proof some of the more breakage-prone parts of the type definitions.
This PR extends
UnknownDecodableto almost every enumeration. It's a little bit of a nuisance to use so I made a couple editorial decisions:Color,Rarity,LegalityorImageStatusbecause they shouldn't change much (if ever) and/or they are used a lot and an extra case is annoyingproducedManawould get its own enum (because of this card) to keep the coreColortype from getting dumbI'm open to any changes. In particular,
ProducedColorcould also be dropped in favor of justString, or I could explicitly addProducedMana.Tinstead of it just being a straight clone ofColor+UnknownDecodable.