Skip to content

Commit da6d59d

Browse files
committed
Remove resource_scope from starting context
1 parent ae03ba4 commit da6d59d

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

crates/bevy_gizmos/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,15 @@ struct LineGizmoHandles {
242242
/// Internally this pushes the parent default context into a swap buffer.
243243
/// Gizmo contexts should be handled like a stack, so if you push a new context,
244244
/// you must pop the context before the parent context ends.
245-
pub fn start_gizmo_context<Config, Clear>(world: &mut World)
245+
pub fn start_gizmo_context<Config, Clear>(
246+
mut swap: ResMut<GizmoStorage<Config, Swap<Clear>>>,
247+
mut default: ResMut<GizmoStorage<Config, ()>>,
248+
)
246249
where
247250
Config: GizmoConfigGroup,
248251
Clear: 'static + Send + Sync,
249252
{
250-
world.resource_scope(
251-
|world: &mut World, mut swap: Mut<GizmoStorage<Config, Swap<Clear>>>| {
252-
let mut default = world.resource_mut::<GizmoStorage<Config, ()>>();
253-
default.swap(&mut *swap);
254-
},
255-
);
253+
default.swap(&mut *swap);
256254
}
257255

258256
/// End this gizmo clearing context.

0 commit comments

Comments
 (0)