@@ -52,7 +52,9 @@ pub struct ReflectComponentFns {
52
52
/// Function pointer implementing [`ReflectComponent::reflect()`].
53
53
pub reflect : fn ( & World , Entity ) -> Option < & dyn Reflect > ,
54
54
/// Function pointer implementing [`ReflectComponent::reflect_mut()`].
55
- /// SAFETY: The function may only be called with an InteriorMutableWorld that can be used to mutably access the relevant component on the given entity
55
+ ///
56
+ /// # Safety
57
+ /// The function may only be called with an [`InteriorMutableWorld`] that can be used to mutably access the relevant component on the given entity.
56
58
pub reflect_mut : unsafe fn ( InteriorMutableWorld < ' _ > , Entity ) -> Option < Mut < ' _ , dyn Reflect > > ,
57
59
/// Function pointer implementing [`ReflectComponent::copy()`].
58
60
pub copy : fn ( & World , & mut World , Entity , Entity ) ,
@@ -211,8 +213,8 @@ impl<C: Component + Reflect + FromWorld> FromType<C> for ReflectComponent {
211
213
} ,
212
214
reflect_mut : |world, entity| {
213
215
// SAFETY: reflect_mut is an unsafe function pointer used by
214
- // 1. `reflect_unchecked_mut` which must be called with an InteriorMutableWorld with access the the component `C` on the `entity`, and
215
- // 2. reflect_mut, which has mutable world access
216
+ // 1. `reflect_unchecked_mut` which must be called with an InteriorMutableWorld with access to the the component `C` on the `entity`, and
217
+ // 2. ` reflect_mut` , which has mutable world access
216
218
unsafe {
217
219
world. get_entity ( entity) ?. get_mut :: < C > ( ) . map ( |c| Mut {
218
220
value : c. value as & mut dyn Reflect ,
@@ -264,7 +266,9 @@ pub struct ReflectResourceFns {
264
266
/// Function pointer implementing [`ReflectResource::reflect()`].
265
267
pub reflect : fn ( & World ) -> Option < & dyn Reflect > ,
266
268
/// Function pointer implementing [`ReflectResource::reflect_unchecked_mut()`].
267
- /// SAFETY: The function may only be called with an InteriorMutableWorld that can be used to mutably access the relevant resource
269
+ ///
270
+ /// # Safety
271
+ /// The function may only be called with an [`InteriorMutableWorld`] that can be used to mutably access the relevant resource.
268
272
pub reflect_unchecked_mut : unsafe fn ( InteriorMutableWorld < ' _ > ) -> Option < Mut < ' _ , dyn Reflect > > ,
269
273
/// Function pointer implementing [`ReflectResource::copy()`].
270
274
pub copy : fn ( & World , & mut World ) ,
@@ -320,7 +324,7 @@ impl ReflectResource {
320
324
/// # Safety
321
325
/// This method does not prevent you from having two mutable pointers to the same data,
322
326
/// violating Rust's aliasing rules. To avoid this:
323
- /// * Only call this method with a [`InteriorMutableWorld`] which can be used to mutably access the resource.
327
+ /// * Only call this method with an [`InteriorMutableWorld`] which can be used to mutably access the resource.
324
328
/// * Don't call this method more than once in the same scope for a given [`Resource`].
325
329
pub unsafe fn reflect_unchecked_mut < ' w > (
326
330
& self ,
0 commit comments