Skip to content

Commit 5de1ae7

Browse files
committed
Fix clippy::let_and_return
1 parent 1b82f1f commit 5de1ae7

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

crates/bevy_ecs/src/archetype.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ impl Archetypes {
942942
let archetypes = &mut self.archetypes;
943943
let archetype_component_count = &mut self.archetype_component_count;
944944
let component_index = &mut self.by_component;
945-
let archetype_id = *self
945+
*self
946946
.by_components
947947
.entry(archetype_identity)
948948
.or_insert_with_key(move |identity| {
@@ -975,8 +975,7 @@ impl Archetypes {
975975
.zip(sparse_set_archetype_components),
976976
));
977977
id
978-
});
979-
archetype_id
978+
})
980979
}
981980

982981
/// Returns the number of components that are stored in archetypes.

crates/bevy_ecs/src/bundle.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ impl Bundles {
15851585
storages: &mut Storages,
15861586
) -> BundleId {
15871587
let bundle_infos = &mut self.bundle_infos;
1588-
let id = *self.bundle_ids.entry(TypeId::of::<T>()).or_insert_with(|| {
1588+
*self.bundle_ids.entry(TypeId::of::<T>()).or_insert_with(|| {
15891589
let mut component_ids= Vec::new();
15901590
T::component_ids(components, &mut |id| component_ids.push(id));
15911591
let id = BundleId(bundle_infos.len());
@@ -1597,8 +1597,7 @@ impl Bundles {
15971597
unsafe { BundleInfo::new(core::any::type_name::<T>(), storages, components, component_ids, id) };
15981598
bundle_infos.push(bundle_info);
15991599
id
1600-
});
1601-
id
1600+
})
16021601
}
16031602

16041603
/// Registers a new [`BundleInfo`], which contains both explicit and required components for a statically known type.

0 commit comments

Comments
 (0)