-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[Merged by Bors] - Remove last uses of string-labels #5420
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
Conversation
f94d708
to
29a1f04
Compare
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.
Looks good! Thanks, I was dreading fixing this.
2f582b0
to
f80e340
Compare
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'm glad we're getting rid of string labels :)
I don't like those macros. They do the same thing as the derives and allow non camel-case structs, which does not spark joy :c
@@ -148,9 +148,13 @@ fn main() { | |||
// Create a new Schedule, which defines an execution strategy for Systems | |||
let mut schedule = Schedule::default(); | |||
|
|||
// Define a unique public name for a new Stage. | |||
#[derive(StageLabel)] | |||
pub struct UpdateLabel; |
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.
nit:
pub struct UpdateLabel; | |
struct UpdateLabel; |
9315db2
to
d8bd716
Compare
Am i missing something, or the added macros are only to remove one line each time, the
is equivalent to
If this is the case, I wonder if the macro are really that useful ? |
It allows you to define a bunch of labels on a single line with no more boilerplate than is necessary. I think we do need to have some way of effortlessly declaring private labels, since the It might be more consistent to replace single-argument macro calls with a derive, though.
I don't think we should be looking at the raw line count. These macros move the boilerplate code somewhere else, where it won't distract from the behavior that actually matters.
If they're useful to us, then they'll be useful to users IMO. |
I don't want to publicize these macros; it's not part of the public API that I want to commit to supporting and they're easy to recreate. |
I just ended up removing the macros entirely. If they're only usable within |
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.
Looks good beside one little thing :)
And I like the enums. They're nice.
This reverts commit 8320c36.
Co-authored-by: ira <[email protected]>
a9a6e14
to
138dfaa
Compare
Just fixed up some merge conflicts. |
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.
Nice work here; thanks for demacroifying the code as requested. Yeet!
bors r+
# Objective * Related: #4341 * Remove all remaining uses of stringly-typed labels in the repo. Right now, it's just a bunch of tests and examples.
Pull request successfully merged into main. Build succeeded: |
# Objective * Related: bevyengine#4341 * Remove all remaining uses of stringly-typed labels in the repo. Right now, it's just a bunch of tests and examples.
# Objective * Related: bevyengine#4341 * Remove all remaining uses of stringly-typed labels in the repo. Right now, it's just a bunch of tests and examples.
Objective