@@ -10,7 +10,7 @@ use crate::{
10
10
QuerySingleError , QueryState , ReadOnlyQueryData ,
11
11
} ,
12
12
storage:: { ResourceData , SparseSetIndex } ,
13
- system:: { Query , QuerySingle , SystemMeta } ,
13
+ system:: { Query , Single , SystemMeta } ,
14
14
world:: { unsafe_world_cell:: UnsafeWorldCell , DeferredWorld , FromWorld , World } ,
15
15
} ;
16
16
use bevy_ecs_macros:: impl_param_set;
@@ -367,11 +367,9 @@ fn assert_component_access_compatibility(
367
367
368
368
// SAFETY: Relevant query ComponentId and ArchetypeComponentId access is applied to SystemMeta. If
369
369
// this Query conflicts with any prior access, a panic will occur.
370
- unsafe impl < ' a , D : QueryData + ' static , F : QueryFilter + ' static > SystemParam
371
- for QuerySingle < ' a , D , F >
372
- {
370
+ unsafe impl < ' a , D : QueryData + ' static , F : QueryFilter + ' static > SystemParam for Single < ' a , D , F > {
373
371
type State = QueryState < D , F > ;
374
- type Item < ' w , ' s > = QuerySingle < ' w , D , F > ;
372
+ type Item < ' w , ' s > = Single < ' w , D , F > ;
375
373
376
374
fn init_state ( world : & mut World , system_meta : & mut SystemMeta ) -> Self :: State {
377
375
Query :: init_state ( world, system_meta)
@@ -399,7 +397,7 @@ unsafe impl<'a, D: QueryData + 'static, F: QueryFilter + 'static> SystemParam
399
397
unsafe { state. get_single_unchecked_manual ( world, system_meta. last_run , change_tick) } ;
400
398
let single =
401
399
result. expect ( "The query was expected to contain exactly one matching entity." ) ;
402
- QuerySingle {
400
+ Single {
403
401
item : single,
404
402
_filter : PhantomData ,
405
403
}
@@ -428,13 +426,13 @@ unsafe impl<'a, D: QueryData + 'static, F: QueryFilter + 'static> SystemParam
428
426
// SAFETY: Relevant query ComponentId and ArchetypeComponentId access is applied to SystemMeta. If
429
427
// this Query conflicts with any prior access, a panic will occur.
430
428
unsafe impl < ' a , D : QueryData + ' static , F : QueryFilter + ' static > SystemParam
431
- for Option < QuerySingle < ' a , D , F > >
429
+ for Option < Single < ' a , D , F > >
432
430
{
433
431
type State = QueryState < D , F > ;
434
- type Item < ' w , ' s > = Option < QuerySingle < ' w , D , F > > ;
432
+ type Item < ' w , ' s > = Option < Single < ' w , D , F > > ;
435
433
436
434
fn init_state ( world : & mut World , system_meta : & mut SystemMeta ) -> Self :: State {
437
- QuerySingle :: init_state ( world, system_meta)
435
+ Single :: init_state ( world, system_meta)
438
436
}
439
437
440
438
unsafe fn new_archetype (
@@ -443,7 +441,7 @@ unsafe impl<'a, D: QueryData + 'static, F: QueryFilter + 'static> SystemParam
443
441
system_meta : & mut SystemMeta ,
444
442
) {
445
443
// SAFETY: Delegate to existing `SystemParam` implementations.
446
- unsafe { QuerySingle :: new_archetype ( state, archetype, system_meta) } ;
444
+ unsafe { Single :: new_archetype ( state, archetype, system_meta) } ;
447
445
}
448
446
449
447
#[ inline]
@@ -458,7 +456,7 @@ unsafe impl<'a, D: QueryData + 'static, F: QueryFilter + 'static> SystemParam
458
456
let result =
459
457
unsafe { state. get_single_unchecked_manual ( world, system_meta. last_run , change_tick) } ;
460
458
match result {
461
- Ok ( single) => Some ( QuerySingle {
459
+ Ok ( single) => Some ( Single {
462
460
item : single,
463
461
_filter : PhantomData ,
464
462
} ) ,
@@ -489,13 +487,13 @@ unsafe impl<'a, D: QueryData + 'static, F: QueryFilter + 'static> SystemParam
489
487
490
488
// SAFETY: QueryState is constrained to read-only fetches, so it only reads World.
491
489
unsafe impl < ' a , D : ReadOnlyQueryData + ' static , F : QueryFilter + ' static > ReadOnlySystemParam
492
- for QuerySingle < ' a , D , F >
490
+ for Single < ' a , D , F >
493
491
{
494
492
}
495
493
496
494
// SAFETY: QueryState is constrained to read-only fetches, so it only reads World.
497
495
unsafe impl < ' a , D : ReadOnlyQueryData + ' static , F : QueryFilter + ' static > ReadOnlySystemParam
498
- for Option < QuerySingle < ' a , D , F > >
496
+ for Option < Single < ' a , D , F > >
499
497
{
500
498
}
501
499
0 commit comments