Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Split out the `Option` and `Expected` types from `Variant` This commit is like prior PRs to split out specializations of types into their own AST type to avoid conflicting with the main type (in this case `variant`). I originally thought these two types would be relatively simple but this is probably one of the more complicated transitions, as evidenced by the lines changed here. The main churn was that variants already have a significant amount of code to support them and this is in some places "duplicating" code for option/expected and in other cases splitting what was already an if/else. Overall I think that the generated code gets a little better since it's clear when something is and `option` vs `expected` now rather than trying to have everything shoehorned into one. Notably the C code generator now generates descriptive fields like `bool is_some` or `bool is_err` instead of a bland `uint8_t tag` with some comments about how to use it. * Remove `Variant::as_{option,expected}` ... as these are separate variants now. * Review comments
- Loading branch information