Skip to content

Commit

Permalink
Remove little warn on bevy_ecs (#11149)
Browse files Browse the repository at this point in the history
# Objective

- There is an warning about non snake case on system_param.rs generated
by a macro

## Solution

- Allow non snake case on the function at fault
  • Loading branch information
pablo-lua authored Jan 1, 2024
1 parent 4fba03b commit bf0be9c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/bevy_ecs/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,16 @@ pub fn impl_param_set(_input: TokenStream) -> TokenStream {
type State = (#(#param::State,)*);
type Item<'w, 's> = ParamSet<'w, 's, (#(#param,)*)>;

// Note: We allow non snake case so the compiler don't complain about the creation of non_snake_case variables
#[allow(non_snake_case)]
fn init_state(world: &mut World, system_meta: &mut SystemMeta) -> Self::State {
#(
// Pretend to add each param to the system alone, see if it conflicts
let mut #meta = system_meta.clone();
#meta.component_access_set.clear();
#meta.archetype_component_access.clear();
#param::init_state(world, &mut #meta);
// The variable is being defined with non_snake_case here
let #param = #param::init_state(world, &mut system_meta.clone());
)*
// Make the ParamSet non-send if any of its parameters are non-send.
Expand Down

0 comments on commit bf0be9c

Please sign in to comment.