Remove unnecessary scopes in App methods (#7813)

# 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.
This commit is contained in:
JoJoJet 2023-02-25 05:08:00 +00:00
parent b8263b55fb
commit af4b95c4e8

View file

@ -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
}
@ -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
}