mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 22:18:33 +00:00
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:
parent
b8263b55fb
commit
af4b95c4e8
1 changed files with 4 additions and 8 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue