Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
plugin_group! macro #11460
plugin_group! macro #11460
Changes from 11 commits
fe97c3c
575b029
244494a
3e4e172
84b6282
4c8b853
93a6a80
2163fd6
14f3dfa
ab5ff97
904f715
a165f69
7edce9f
72838cf
a647ac1
397ac7f
78523ff
a6b12d4
79c9778
8a185ed
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This will fail to compile if
PluginGroup
andPluginGroupBuilder
are not imported. Using$crate
will fix this.Additionally,
#[allow(unused_mut)]
will allow an emptyplugin_group!(MyPlugins {})
to build without warnings.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.
Why would you want to create a plugin group with no plugins?
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 don't think there is any long-term use of having an empty plugin group, but I could see someone testing the macro empty and being confused why
rustc
is raising an warning on code they can't see. Additionally the macro doesn't prevent you from creating an empty group, so it's bound to happen at some point.I don't think the extra
#[allow(...)]
annotation will be confusing for future reviewers, but feel free to add a comment explaining why it's there. It can't hurt :)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.
It would be nice if it would document not targeting
wasm32
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.
It would be nice, but it would be quite difficult to implement this with the macro.
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.
The original
DefaultPlugins
documentation didn't mention this requirement. So I don't think that's necessary.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.
It did.
bevy/crates/bevy_internal/src/default_plugins.rs
Line 19 in 10f9595
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.
Ah mb