-
-
Notifications
You must be signed in to change notification settings - Fork 759
refactor(ast_codegen): simplify derive_get_span generator
#4757
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
refactor(ast_codegen): simplify derive_get_span generator
#4757
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @overlookmotel and the rest of your teammates on |
CodSpeed Performance ReportMerging #4757 will not alter performanceComparing Summary
|
|
What do you think @rzvxa? Personally I find this style less convoluted and a lot easier to understand. NB: Rather than looking at the diff, I'd suggest comparing before and after. |
TBH, I don't have a strong preference here. I'll merge it in if you like it more this way. |
Merge activity
|
Simplify `derive_get_span` generator that was introduced in #4735. No change to functionality, just aiming for greater readability. In particular: * Move defining idents/tokens which are specific to `GetSpan` / `GetSpanMut` into those specific generators, rather than branching on `MUT` later on. * Remove `const MUT` param. * Remove the confusing pairs of closures and functions both called `derive_enum` / `derive_struct`. * Inline function which generates the impls - prioritizing readability over DRY code.
1b9561b to
790c551
Compare

Simplify
derive_get_spangenerator that was introduced in #4735. No change to functionality, just aiming for greater readability.In particular:
GetSpan/GetSpanMutinto those specific generators, rather than branching onMUTlater on.const MUTparam.derive_enum/derive_struct.