@@ -3,7 +3,7 @@ use crate::{
3
3
component:: ComponentId ,
4
4
query:: Access ,
5
5
schedule:: { BoxedRunCriteriaLabel , GraphNode , RunCriteriaLabel } ,
6
- system:: { BoxedSystem , System , SystemId } ,
6
+ system:: { BoxedSystem , IntoSystem , System , SystemId } ,
7
7
world:: World ,
8
8
} ;
9
9
use std:: borrow:: Cow ;
@@ -197,12 +197,14 @@ impl IntoRunCriteria<BoxedSystem<(), ShouldRun>> for BoxedSystem<(), ShouldRun>
197
197
}
198
198
}
199
199
200
- impl < S > IntoRunCriteria < BoxedSystem < ( ) , ShouldRun > > for S
200
+ impl < S , Param > IntoRunCriteria < ( BoxedSystem < ( ) , ShouldRun > , Param ) > for S
201
201
where
202
- S : System < In = ( ) , Out = ShouldRun > ,
202
+ S : IntoSystem < ( ) , ShouldRun , Param > ,
203
203
{
204
204
fn into ( self ) -> RunCriteriaDescriptorOrLabel {
205
- RunCriteriaDescriptorOrLabel :: Descriptor ( new_run_criteria_descriptor ( Box :: new ( self ) ) )
205
+ RunCriteriaDescriptorOrLabel :: Descriptor ( new_run_criteria_descriptor ( Box :: new (
206
+ self . system ( ) ,
207
+ ) ) )
206
208
}
207
209
}
208
210
@@ -227,7 +229,7 @@ impl IntoRunCriteria<RunCriteria> for RunCriteria {
227
229
}
228
230
}
229
231
230
- pub trait RunCriteriaDescriptorCoercion {
232
+ pub trait RunCriteriaDescriptorCoercion < Param > {
231
233
/// Assigns a label to the criteria. Must be unique.
232
234
fn label ( self , label : impl RunCriteriaLabel ) -> RunCriteriaDescriptor ;
233
235
@@ -242,7 +244,7 @@ pub trait RunCriteriaDescriptorCoercion {
242
244
fn after ( self , label : impl RunCriteriaLabel ) -> RunCriteriaDescriptor ;
243
245
}
244
246
245
- impl RunCriteriaDescriptorCoercion for RunCriteriaDescriptor {
247
+ impl RunCriteriaDescriptorCoercion < ( ) > for RunCriteriaDescriptor {
246
248
fn label ( mut self , label : impl RunCriteriaLabel ) -> RunCriteriaDescriptor {
247
249
self . label = Some ( Box :: new ( label) ) ;
248
250
self . duplicate_label_strategy = DuplicateLabelStrategy :: Panic ;
@@ -276,7 +278,7 @@ fn new_run_criteria_descriptor(system: BoxedSystem<(), ShouldRun>) -> RunCriteri
276
278
}
277
279
}
278
280
279
- impl RunCriteriaDescriptorCoercion for BoxedSystem < ( ) , ShouldRun > {
281
+ impl RunCriteriaDescriptorCoercion < ( ) > for BoxedSystem < ( ) , ShouldRun > {
280
282
fn label ( self , label : impl RunCriteriaLabel ) -> RunCriteriaDescriptor {
281
283
new_run_criteria_descriptor ( self ) . label ( label)
282
284
}
@@ -294,24 +296,24 @@ impl RunCriteriaDescriptorCoercion for BoxedSystem<(), ShouldRun> {
294
296
}
295
297
}
296
298
297
- impl < S > RunCriteriaDescriptorCoercion for S
299
+ impl < S , Param > RunCriteriaDescriptorCoercion < Param > for S
298
300
where
299
- S : System < In = ( ) , Out = ShouldRun > ,
301
+ S : IntoSystem < ( ) , ShouldRun , Param > ,
300
302
{
301
303
fn label ( self , label : impl RunCriteriaLabel ) -> RunCriteriaDescriptor {
302
- new_run_criteria_descriptor ( Box :: new ( self ) ) . label ( label)
304
+ new_run_criteria_descriptor ( Box :: new ( self . system ( ) ) ) . label ( label)
303
305
}
304
306
305
307
fn label_discard_if_duplicate ( self , label : impl RunCriteriaLabel ) -> RunCriteriaDescriptor {
306
- new_run_criteria_descriptor ( Box :: new ( self ) ) . label_discard_if_duplicate ( label)
308
+ new_run_criteria_descriptor ( Box :: new ( self . system ( ) ) ) . label_discard_if_duplicate ( label)
307
309
}
308
310
309
311
fn before ( self , label : impl RunCriteriaLabel ) -> RunCriteriaDescriptor {
310
- new_run_criteria_descriptor ( Box :: new ( self ) ) . before ( label)
312
+ new_run_criteria_descriptor ( Box :: new ( self . system ( ) ) ) . before ( label)
311
313
}
312
314
313
315
fn after ( self , label : impl RunCriteriaLabel ) -> RunCriteriaDescriptor {
314
- new_run_criteria_descriptor ( Box :: new ( self ) ) . after ( label)
316
+ new_run_criteria_descriptor ( Box :: new ( self . system ( ) ) ) . after ( label)
315
317
}
316
318
}
317
319
0 commit comments