@@ -76,22 +76,14 @@ impl<'w> EntityRef<'w> {
76
76
77
77
#[ inline]
78
78
pub fn contains_id ( & self , component_id : ComponentId ) -> bool {
79
- // SAFETY:
80
- // - `EntityRef` existing requires there not to be a `&mut World`
81
- unsafe {
82
- self . as_unsafe_world_cell_readonly ( )
83
- . contains_id ( component_id)
84
- }
79
+ self . as_unsafe_world_cell_readonly ( )
80
+ . contains_id ( component_id)
85
81
}
86
82
87
83
#[ inline]
88
84
pub fn contains_type_id ( & self , type_id : TypeId ) -> bool {
89
- // SAFETY:
90
- // - `EntityRef` existing requires there not to be a `&mut World`
91
- unsafe {
92
- self . as_unsafe_world_cell_readonly ( )
93
- . contains_type_id ( type_id)
94
- }
85
+ self . as_unsafe_world_cell_readonly ( )
86
+ . contains_type_id ( type_id)
95
87
}
96
88
97
89
#[ inline]
@@ -216,22 +208,14 @@ impl<'w> EntityMut<'w> {
216
208
217
209
#[ inline]
218
210
pub fn contains_id ( & self , component_id : ComponentId ) -> bool {
219
- // SAFETY:
220
- // - `EntityMut` has exclusive access on world so noone else can have a `&mut World`
221
- unsafe {
222
- self . as_unsafe_world_cell_readonly ( )
223
- . contains_id ( component_id)
224
- }
211
+ self . as_unsafe_world_cell_readonly ( )
212
+ . contains_id ( component_id)
225
213
}
226
214
227
215
#[ inline]
228
216
pub fn contains_type_id ( & self , type_id : TypeId ) -> bool {
229
- // SAFETY:
230
- // - `EntityMut` has exclusive access on world so noone else can have a `&mut World`
231
- unsafe {
232
- self . as_unsafe_world_cell_readonly ( )
233
- . contains_type_id ( type_id)
234
- }
217
+ self . as_unsafe_world_cell_readonly ( )
218
+ . contains_type_id ( type_id)
235
219
}
236
220
237
221
#[ inline]
0 commit comments