-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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: use macro to remove duplication of workspace inheritable fields getters #12317
Conversation
Not sure why but I had a hard time reproducing it on a Linux machine. @bors try |
refactor: use macro to remove duplication of workspace inheritable fields getters
💥 Test timed out |
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.
Overall this is a good change. One of my biggest regrets with workspace inheritance was not finding a way to reduce the amount of duplicate code. This is an excellent step in that direction!
My only concern would be with the potential drift in the doc comments for the getters as some are handwritten while the rest are generated by the macro. This is a very minor concern that doesn't need to be dealt with in currently, but it is something to note.
324af1d
to
e313b61
Compare
Thanks for the feedback! It's ready for the next round of review :) |
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.
Thanks!
@bors r+
Not sure why bors didn't work, so I'll approve it again @bors r+ |
☀️ Test successful - checks-actions |
Update cargo 6 commits in 03bc66b55c290324bd46eb22e369c8fae1908f91..5b377cece0e0dd0af686cf53ce4637d5d85c2a10 2023-06-23 23:27:46 +0000 to 2023-06-30 00:01:00 +0000 - Add READMEs for the credential helpers. (rust-lang/cargo#12322) - Add some more documentation for Source download functions. (rust-lang/cargo#12319) - Don't try to compile cargo-credential-gnome-secret on non-Linux platforms. (rust-lang/cargo#12321) - refactor: use macro to remove duplication of workspace inheritable fields getters (rust-lang/cargo#12317) - doc: should be `.cargo-ok` (rust-lang/cargo#12318) - refactor(registry): extract and rearrange items to their own modules (rust-lang/cargo#12290) r? `@ghost`
What does this PR try to resolve?
Use macros to avoid repeating the getter method definitions in workspace inheritable fields.
This also removes some unnecessary clones.
How should we test and review this PR?
I am not sure if it is preferable. Feel free to reject and close.
r? @Muscraft