Skip to content

Commit 8dcb6f1

Browse files
committed
Rename EntityBorrow to ContainsEntity and TrustedEntityBorrow to EntityEquivalent
1 parent 84b09b9 commit 8dcb6f1

File tree

18 files changed

+393
-409
lines changed

18 files changed

+393
-409
lines changed

crates/bevy_ecs/src/entity/entity_set.rs

Lines changed: 79 additions & 74 deletions
Large diffs are not rendered by default.

crates/bevy_ecs/src/entity/hash_map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use bevy_platform_support::collections::hash_map::{self, HashMap};
1313
#[cfg(feature = "bevy_reflect")]
1414
use bevy_reflect::Reflect;
1515

16-
use super::{Entity, EntityHash, EntitySetIterator, TrustedEntityBorrow};
16+
use super::{Entity, EntityEquivalent, EntityHash, EntitySetIterator};
1717

1818
/// A [`HashMap`] pre-configured to use [`EntityHash`] hashing.
1919
#[cfg_attr(feature = "bevy_reflect", derive(Reflect))]
@@ -113,7 +113,7 @@ impl<V> FromIterator<(Entity, V)> for EntityHashMap<V> {
113113
}
114114
}
115115

116-
impl<V, Q: TrustedEntityBorrow + ?Sized> Index<&Q> for EntityHashMap<V> {
116+
impl<V, Q: EntityEquivalent + ?Sized> Index<&Q> for EntityHashMap<V> {
117117
type Output = V;
118118
fn index(&self, key: &Q) -> &V {
119119
self.0.index(&key.entity())

crates/bevy_ecs/src/entity/index_map.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use core::{
1919
use bevy_reflect::Reflect;
2020
use indexmap::map::{self, IndexMap, IntoValues, ValuesMut};
2121

22-
use super::{Entity, EntityHash, EntitySetIterator, TrustedEntityBorrow};
22+
use super::{Entity, EntityEquivalent, EntityHash, EntitySetIterator};
2323

2424
use bevy_platform_support::prelude::Box;
2525

@@ -176,7 +176,7 @@ impl<V> FromIterator<(Entity, V)> for EntityIndexMap<V> {
176176
}
177177
}
178178

179-
impl<V, Q: TrustedEntityBorrow + ?Sized> Index<&Q> for EntityIndexMap<V> {
179+
impl<V, Q: EntityEquivalent + ?Sized> Index<&Q> for EntityIndexMap<V> {
180180
type Output = V;
181181
fn index(&self, key: &Q) -> &V {
182182
self.0.index(&key.entity())
@@ -246,7 +246,7 @@ impl<V> Index<usize> for EntityIndexMap<V> {
246246
}
247247
}
248248

249-
impl<V, Q: TrustedEntityBorrow + ?Sized> IndexMut<&Q> for EntityIndexMap<V> {
249+
impl<V, Q: EntityEquivalent + ?Sized> IndexMut<&Q> for EntityIndexMap<V> {
250250
fn index_mut(&mut self, key: &Q) -> &mut V {
251251
self.0.index_mut(&key.entity())
252252
}

0 commit comments

Comments
 (0)