-
Notifications
You must be signed in to change notification settings - Fork 115
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
Rework attribute parsing #290
Conversation
rename_all: variant_attr.rename_all.or(match variant_fields { | ||
Fields::Named(_) => enum_attr.rename_all_fields, | ||
Fields::Unnamed(_) | Fields::Unit => None, | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I managed to move the rename_all_fields
match to a better location and get rid of that duplicated mehtod
I'll take a closer look once I get home, but I love what I've seen so far. Great work! |
Great stuff, nothing here I don't like! |
Right as you say that I push a compiler error lmao |
What was the reasoning behind the last commit? Was there a bug I missed? |
😆 |
I thought it was weird passing the |
I think that was the last thing that I wanted to change, as long as you like the latest commit, I think this is ready to merge |
Actually, I just realized that the |
Yeah, that's true. I too thought passing in the "previous" attrs was a tiny bit akward, but I think I preferred it over having the separate |
In ba04528 removing |
Alright, I think I'm happy with this now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So am I!
Great work, super happy you tackled this!
Goal
This PR aims to change the way we parse attributes in a few key ways:
merge
method to remove the mutable referencefor_each
that mutates external data is somewhat confusing, so I changed it to usefold
(think JSArray.protoype.reduce
) instead.Checklist