From 7ac283cffa6a48ffe7c1d792f85087f65dc446d1 Mon Sep 17 00:00:00 2001 From: james7132 Date: Sat, 30 Mar 2024 16:28:31 -0700 Subject: [PATCH] Formatting --- crates/bevy_ecs/src/query/iter.rs | 15 +++++++++++++-- crates/bevy_ecs/src/query/par_iter.rs | 7 ++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/crates/bevy_ecs/src/query/iter.rs b/crates/bevy_ecs/src/query/iter.rs index d22d1ec75b07d..c96d054abdaa2 100644 --- a/crates/bevy_ecs/src/query/iter.rs +++ b/crates/bevy_ecs/src/query/iter.rs @@ -743,10 +743,21 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryIterationCursor<'w, 's, D, F> { let ids = self.storage_id_iter.clone(); let remaining_matched: usize = if Self::IS_DENSE { // SAFETY: The if check ensures that storage_id_iter stores TableIds - unsafe { ids.map(|id| tables.get(id.table_id).debug_checked_unwrap().entity_count()).sum() } + unsafe { + ids.map(|id| { + tables + .get(id.table_id) + .debug_checked_unwrap() + .entity_count() + }) + .sum() + } } else { // SAFETY: The if check ensures that storage_id_iter stores ArchetypeIds - unsafe { ids.map(|id| archetypes.get(id.archetype_id).debug_checked_unwrap().len()).sum() } + unsafe { + ids.map(|id| archetypes.get(id.archetype_id).debug_checked_unwrap().len()) + .sum() + } }; remaining_matched + self.current_len - self.current_row } diff --git a/crates/bevy_ecs/src/query/par_iter.rs b/crates/bevy_ecs/src/query/par_iter.rs index 6b59372c97713..8936512c8e222 100644 --- a/crates/bevy_ecs/src/query/par_iter.rs +++ b/crates/bevy_ecs/src/query/par_iter.rs @@ -168,7 +168,12 @@ impl<'w, 's, D: QueryData, F: QueryFilter> QueryParIter<'w, 's, D, F> { let tables = unsafe { &self.world.world_metadata().storages().tables }; id_iter // SAFETY: The if check ensures that matched_storage_ids stores TableIds - .map(|id| unsafe { tables.get(id.table_id).debug_checked_unwrap().entity_count() }) + .map(|id| unsafe { + tables + .get(id.table_id) + .debug_checked_unwrap() + .entity_count() + }) .max() } else { let archetypes = &self.world.archetypes();