diff --git a/crates/bevy_ecs/src/archetype.rs b/crates/bevy_ecs/src/archetype.rs index e6ae5e4ae3..f55acf6d35 100644 --- a/crates/bevy_ecs/src/archetype.rs +++ b/crates/bevy_ecs/src/archetype.rs @@ -942,7 +942,7 @@ impl Archetypes { let archetypes = &mut self.archetypes; let archetype_component_count = &mut self.archetype_component_count; let component_index = &mut self.by_component; - let archetype_id = *self + *self .by_components .entry(archetype_identity) .or_insert_with_key(move |identity| { @@ -975,8 +975,7 @@ impl Archetypes { .zip(sparse_set_archetype_components), )); id - }); - archetype_id + }) } /// Returns the number of components that are stored in archetypes. diff --git a/crates/bevy_ecs/src/bundle.rs b/crates/bevy_ecs/src/bundle.rs index 5946819032..d87ef517f1 100644 --- a/crates/bevy_ecs/src/bundle.rs +++ b/crates/bevy_ecs/src/bundle.rs @@ -1585,7 +1585,7 @@ impl Bundles { storages: &mut Storages, ) -> BundleId { let bundle_infos = &mut self.bundle_infos; - let id = *self.bundle_ids.entry(TypeId::of::()).or_insert_with(|| { + *self.bundle_ids.entry(TypeId::of::()).or_insert_with(|| { let mut component_ids= Vec::new(); T::component_ids(components, &mut |id| component_ids.push(id)); let id = BundleId(bundle_infos.len()); @@ -1597,8 +1597,7 @@ impl Bundles { unsafe { BundleInfo::new(core::any::type_name::(), storages, components, component_ids, id) }; bundle_infos.push(bundle_info); id - }); - id + }) } /// Registers a new [`BundleInfo`], which contains both explicit and required components for a statically known type.