@@ -211,9 +211,10 @@ impl Schedule {
211
211
)
212
212
}
213
213
214
+ let stage_label = stage_label. as_label ( ) ;
214
215
let stage = self
215
- . get_stage_mut :: < SystemStage > ( & stage_label)
216
- . unwrap_or_else ( move || stage_not_found ( & stage_label. as_label ( ) ) ) ;
216
+ . get_stage_mut :: < SystemStage > ( stage_label)
217
+ . unwrap_or_else ( move || stage_not_found ( & stage_label) ) ;
217
218
stage. add_system ( system) ;
218
219
self
219
220
}
@@ -281,11 +282,9 @@ impl Schedule {
281
282
label : impl StageLabel ,
282
283
func : F ,
283
284
) -> & mut Self {
284
- let stage = self . get_stage_mut :: < T > ( & label) . unwrap_or_else ( move || {
285
- panic ! (
286
- "stage '{:?}' does not exist or is the wrong type" ,
287
- label. as_label( )
288
- )
285
+ let label = label. as_label ( ) ;
286
+ let stage = self . get_stage_mut :: < T > ( label) . unwrap_or_else ( move || {
287
+ panic ! ( "stage '{label:?}' does not exist or is the wrong type" )
289
288
} ) ;
290
289
func ( stage) ;
291
290
self
@@ -304,9 +303,9 @@ impl Schedule {
304
303
/// # let mut schedule = Schedule::default();
305
304
/// # schedule.add_stage("my_stage", SystemStage::parallel());
306
305
/// #
307
- /// let stage = schedule.get_stage::<SystemStage>(& "my_stage").unwrap();
306
+ /// let stage = schedule.get_stage::<SystemStage>("my_stage").unwrap();
308
307
/// ```
309
- pub fn get_stage < T : Stage > ( & self , label : & dyn StageLabel ) -> Option < & T > {
308
+ pub fn get_stage < T : Stage > ( & self , label : impl StageLabel ) -> Option < & T > {
310
309
self . stages
311
310
. get ( & label. as_label ( ) )
312
311
. and_then ( |stage| stage. downcast_ref :: < T > ( ) )
@@ -325,9 +324,9 @@ impl Schedule {
325
324
/// # let mut schedule = Schedule::default();
326
325
/// # schedule.add_stage("my_stage", SystemStage::parallel());
327
326
/// #
328
- /// let stage = schedule.get_stage_mut::<SystemStage>(& "my_stage").unwrap();
327
+ /// let stage = schedule.get_stage_mut::<SystemStage>("my_stage").unwrap();
329
328
/// ```
330
- pub fn get_stage_mut < T : Stage > ( & mut self , label : & dyn StageLabel ) -> Option < & mut T > {
329
+ pub fn get_stage_mut < T : Stage > ( & mut self , label : impl StageLabel ) -> Option < & mut T > {
331
330
self . stages
332
331
. get_mut ( & label. as_label ( ) )
333
332
. and_then ( |stage| stage. downcast_mut :: < T > ( ) )
0 commit comments