@@ -13,8 +13,8 @@ use crate::world::{Mut, World};
1313///
1414/// Any [`Commands`](crate::system::Commands) generated by these systems (but not other systems), will immediately be applied.
1515///
16- /// This type is stored as a [`Resource`](crate::system::Resource) on each [`World`], initialized by default .
17- /// However, it will likely be easier to use the corresponding methods on [`World`],
16+ /// This type is stored as a field on each [`World`].
17+ /// Geneerally speaking, you should use the corresponding methods on [`World`],
1818/// to avoid having to worry about split mutable borrows yourself.
1919///
2020/// # Limitations
@@ -293,9 +293,7 @@ impl World {
293293 system : S ,
294294 label : L ,
295295 ) {
296- self . resource_scope ( |world, mut registry : Mut < SystemRegistry > | {
297- registry. register_system ( world, system, label) ;
298- } ) ;
296+ self . system_registry . register_system ( self , system, label) ;
299297 }
300298
301299 pub fn register_system_with_labels <
@@ -308,9 +306,8 @@ impl World {
308306 system : S ,
309307 labels : LI ,
310308 ) {
311- self . resource_scope ( |world, mut registry : Mut < SystemRegistry > | {
312- registry. register_system_with_labels ( world, system, labels) ;
313- } ) ;
309+ self . system_registry
310+ . register_system_with_labels ( self , system, labels) ;
314311 }
315312
316313 /// Runs the supplied system on the [`World`] a single time
@@ -325,9 +322,7 @@ impl World {
325322 /// at once, and want parallel execution of these systems.
326323 #[ inline]
327324 pub fn run_system < Params , S : IntoSystem < ( ) , ( ) , Params > + ' static > ( & mut self , system : S ) {
328- self . resource_scope ( |world, mut registry : Mut < SystemRegistry > | {
329- registry. run_system ( world, system) ;
330- } ) ;
325+ self . system_registry . run_system ( self , system) ;
331326 }
332327
333328 /// Runs the system corresponding to the supplied [`SystemLabel`] on the [`World`] a single time
@@ -344,9 +339,7 @@ impl World {
344339 /// at once, and want parallel execution of these systems.
345340 #[ inline]
346341 pub fn run_systems_by_label < L : SystemLabel > ( & mut self , label : L ) {
347- self . resource_scope ( |world, mut registry : Mut < SystemRegistry > | {
348- registry. run_systems_by_label ( world, label) ;
349- } ) ;
342+ self . system_registry . run_systems_by_label ( self , label) ;
350343 }
351344}
352345
0 commit comments