Skip to content

Commit ecf4c52

Browse files
committed
readd safety comment
1 parent d9c713d commit ecf4c52

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/bevy_asset/src/reflect.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ pub struct ReflectAsset {
1818
assets_resource_type_id: TypeId,
1919

2020
get: fn(&World, HandleUntyped) -> Option<&dyn PartialReflect>,
21+
// SAFETY:
22+
// - may only be called with a [`IteriorMutableWorld`] which can be used to access the corresponding `Assets<T>` resource mutably
23+
// - may only be used to access **at most one** access at once
2124
get_unchecked_mut:
2225
unsafe fn(UnsafeWorldCell<'_>, HandleUntyped) -> Option<&mut dyn PartialReflect>,
2326
add: fn(&mut World, &dyn PartialReflect) -> HandleUntyped,

0 commit comments

Comments
 (0)