Skip to content

Commit 7a18fb1

Browse files
fix bevy_asset doc test
1 parent 7d028ea commit 7a18fb1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/bevy_asset/src/reflect.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ impl ReflectAsset {
7171
/// # use bevy_asset::{ReflectAsset, HandleUntyped};
7272
/// # use bevy_ecs::prelude::World;
7373
/// # let reflect_asset: ReflectAsset = unimplemented!();
74-
/// # let world: World = unimplemented!();
74+
/// # let mut world: World = unimplemented!();
7575
/// # let handle_1: HandleUntyped = unimplemented!();
7676
/// # let handle_2: HandleUntyped = unimplemented!();
77-
/// let a = unsafe { reflect_asset.get_unchecked_mut(&world, handle_1).unwrap() };
78-
/// let b = unsafe { reflect_asset.get_unchecked_mut(&world, handle_2).unwrap() };
77+
/// let interior_mutable_world = world.as_interior_mutable();
78+
/// let a = unsafe { reflect_asset.get_unchecked_mut(interior_mutable_world, handle_1).unwrap() };
79+
/// let b = unsafe { reflect_asset.get_unchecked_mut(interior_mutable_world, handle_2).unwrap() };
7980
/// // ^ not allowed, two mutable references through the same asset resource, even though the
8081
/// // handles are distinct
8182
///

0 commit comments

Comments
 (0)