Skip to content

Commit

Permalink
style: reorder remove_resource
Browse files Browse the repository at this point in the history
This makes the declaration order consistent with the surrounding methods of `Commands::remove_resource`. This is an opinionated change that I would be fine with reverting.
  • Loading branch information
BD103 committed Mar 31, 2024
1 parent 50699ec commit 13e0f17
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/bevy_ecs/src/system/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1122,18 +1122,18 @@ fn init_resource<R: Resource + FromWorld>(world: &mut World) {
world.init_resource::<R>();
}

/// A [`Command`] that removes the [resource](Resource) `R` from the world.
fn remove_resource<R: Resource>(world: &mut World) {
world.remove_resource::<R>();
}

/// A [`Command`] that inserts a [`Resource`] into the world.
fn insert_resource<R: Resource>(resource: R) -> impl Command {
move |world: &mut World| {
world.insert_resource(resource);
}
}

/// A [`Command`] that removes the [resource](Resource) `R` from the world.
fn remove_resource<R: Resource>(world: &mut World) {
world.remove_resource::<R>();
}

/// [`EntityCommand`] to log the components of a given entity. See [`EntityCommands::log_components`].
fn log_components(entity: Entity, world: &mut World) {
let debug_infos: Vec<_> = world
Expand Down

0 comments on commit 13e0f17

Please sign in to comment.