Skip to content

Commit

Permalink
cargo fmt after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecificProtagonist committed Jan 10, 2025
1 parent e21596e commit 2e894a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
3 changes: 0 additions & 3 deletions crates/bevy_ecs/src/entity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -986,8 +986,6 @@ impl Entities {
&self,
entity: Entity,
) -> Option<&'static Location<'static>> {
let meta = self.meta.get(entity.index() as usize);
std::println!("{entity} → {meta:?}");
self.meta.get(entity.index() as usize).and_then(|meta| {
// Generation is incremented immediately upon despawn
if (meta.generation == entity.generation)
Expand All @@ -1006,7 +1004,6 @@ impl Entities {
&self,
_entity: Entity,
) -> EntityDoesNotExistDetails {
#[cfg(feature = "track_location")]
EntityDoesNotExistDetails {
#[cfg(feature = "track_location")]
location: self.entity_get_spawned_or_despawned_by(_entity),
Expand Down
4 changes: 1 addition & 3 deletions crates/bevy_ecs/src/query/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,9 +1018,7 @@ impl<D: QueryData, F: QueryFilter> QueryState<D, F> {
.get(entity)
.ok_or(QueryEntityError::NoSuchEntity(
entity,
world
.entities()
.entity_does_not_exist_error_details(entity),
world.entities().entity_does_not_exist_error_details(entity),
))?;
if !self
.matched_archetypes
Expand Down
15 changes: 5 additions & 10 deletions crates/bevy_ecs/src/world/entity_fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ unsafe impl WorldEntityFetch for Entity {
.get(self)
.ok_or(EntityFetchError::NoSuchEntity(
self,
cell.entities()
.entity_does_not_exist_error_details(self),
cell.entities().entity_does_not_exist_error_details(self),
))?;
// SAFETY: caller ensures that the world cell has mutable access to the entity.
let world = unsafe { cell.world_mut() };
Expand All @@ -139,8 +138,7 @@ unsafe impl WorldEntityFetch for Entity {
) -> Result<Self::DeferredMut<'_>, EntityFetchError> {
let ecell = cell.get_entity(self).ok_or(EntityFetchError::NoSuchEntity(
self,
cell.entities()
.entity_does_not_exist_error_details(self),
cell.entities().entity_does_not_exist_error_details(self),
))?;
// SAFETY: caller ensures that the world cell has mutable access to the entity.
Ok(unsafe { EntityMut::new(ecell) })
Expand Down Expand Up @@ -215,8 +213,7 @@ unsafe impl<const N: usize> WorldEntityFetch for &'_ [Entity; N] {
for (r, &id) in core::iter::zip(&mut refs, self) {
let ecell = cell.get_entity(id).ok_or(EntityFetchError::NoSuchEntity(
id,
cell.entities()
.entity_does_not_exist_error_details(id),
cell.entities().entity_does_not_exist_error_details(id),
))?;
// SAFETY: caller ensures that the world cell has mutable access to the entity.
*r = MaybeUninit::new(unsafe { EntityMut::new(ecell) });
Expand Down Expand Up @@ -275,8 +272,7 @@ unsafe impl WorldEntityFetch for &'_ [Entity] {
for &id in self {
let ecell = cell.get_entity(id).ok_or(EntityFetchError::NoSuchEntity(
id,
cell.entities()
.entity_does_not_exist_error_details(id),
cell.entities().entity_does_not_exist_error_details(id),
))?;
// SAFETY: caller ensures that the world cell has mutable access to the entity.
refs.push(unsafe { EntityMut::new(ecell) });
Expand Down Expand Up @@ -322,8 +318,7 @@ unsafe impl WorldEntityFetch for &'_ EntityHashSet {
for &id in self {
let ecell = cell.get_entity(id).ok_or(EntityFetchError::NoSuchEntity(
id,
cell.entities()
.entity_does_not_exist_error_details(id),
cell.entities().entity_does_not_exist_error_details(id),
))?;
// SAFETY: caller ensures that the world cell has mutable access to the entity.
refs.insert(id, unsafe { EntityMut::new(ecell) });
Expand Down

0 comments on commit 2e894a0

Please sign in to comment.