Skip to content

Commit

Permalink
Remove unnecessary scopes in App methods (#7813)
Browse files Browse the repository at this point in the history
# Objective

A couple of places in `bevy_app` use a scoped block that doesn't do anything. I imagine these are a relic from when `Mut<T>` implemented `Drop` in the early days of bevy.

## Solution

Remove the scopes.
  • Loading branch information
JoJoJet committed Feb 25, 2023
1 parent b8263b5 commit af4b95c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions crates/bevy_app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -849,10 +849,8 @@ impl App {
/// See [`bevy_reflect::TypeRegistry::register`].
#[cfg(feature = "bevy_reflect")]
pub fn register_type<T: bevy_reflect::GetTypeRegistration>(&mut self) -> &mut Self {
{
let registry = self.world.resource_mut::<AppTypeRegistry>();
registry.write().register::<T>();
}
let registry = self.world.resource_mut::<AppTypeRegistry>();
registry.write().register::<T>();
self
}

Expand Down Expand Up @@ -882,10 +880,8 @@ impl App {
>(
&mut self,
) -> &mut Self {
{
let registry = self.world.resource_mut::<AppTypeRegistry>();
registry.write().register_type_data::<T, D>();
}
let registry = self.world.resource_mut::<AppTypeRegistry>();
registry.write().register_type_data::<T, D>();
self
}

Expand Down

0 comments on commit af4b95c

Please sign in to comment.