@@ -10,7 +10,7 @@ use crate::{
1010 QuerySingleError , QueryState , ReadOnlyQueryData ,
1111 } ,
1212 storage:: { ResourceData , SparseSetIndex } ,
13- system:: { Query , QuerySingle , SystemMeta } ,
13+ system:: { Query , Single , SystemMeta } ,
1414 world:: { unsafe_world_cell:: UnsafeWorldCell , DeferredWorld , FromWorld , World } ,
1515} ;
1616use bevy_ecs_macros:: impl_param_set;
@@ -367,11 +367,9 @@ fn assert_component_access_compatibility(
367367
368368// SAFETY: Relevant query ComponentId and ArchetypeComponentId access is applied to SystemMeta. If
369369// 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 > {
373371 type State = QueryState < D , F > ;
374- type Item < ' w , ' s > = QuerySingle < ' w , D , F > ;
372+ type Item < ' w , ' s > = Single < ' w , D , F > ;
375373
376374 fn init_state ( world : & mut World , system_meta : & mut SystemMeta ) -> Self :: State {
377375 Query :: init_state ( world, system_meta)
@@ -399,7 +397,7 @@ unsafe impl<'a, D: QueryData + 'static, F: QueryFilter + 'static> SystemParam
399397 unsafe { state. get_single_unchecked_manual ( world, system_meta. last_run , change_tick) } ;
400398 let single =
401399 result. expect ( "The query was expected to contain exactly one matching entity." ) ;
402- QuerySingle {
400+ Single {
403401 item : single,
404402 _filter : PhantomData ,
405403 }
@@ -428,13 +426,13 @@ unsafe impl<'a, D: QueryData + 'static, F: QueryFilter + 'static> SystemParam
428426// SAFETY: Relevant query ComponentId and ArchetypeComponentId access is applied to SystemMeta. If
429427// this Query conflicts with any prior access, a panic will occur.
430428unsafe impl < ' a , D : QueryData + ' static , F : QueryFilter + ' static > SystemParam
431- for Option < QuerySingle < ' a , D , F > >
429+ for Option < Single < ' a , D , F > >
432430{
433431 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 > > ;
435433
436434 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)
438436 }
439437
440438 unsafe fn new_archetype (
@@ -443,7 +441,7 @@ unsafe impl<'a, D: QueryData + 'static, F: QueryFilter + 'static> SystemParam
443441 system_meta : & mut SystemMeta ,
444442 ) {
445443 // SAFETY: Delegate to existing `SystemParam` implementations.
446- unsafe { QuerySingle :: new_archetype ( state, archetype, system_meta) } ;
444+ unsafe { Single :: new_archetype ( state, archetype, system_meta) } ;
447445 }
448446
449447 #[ inline]
@@ -458,7 +456,7 @@ unsafe impl<'a, D: QueryData + 'static, F: QueryFilter + 'static> SystemParam
458456 let result =
459457 unsafe { state. get_single_unchecked_manual ( world, system_meta. last_run , change_tick) } ;
460458 match result {
461- Ok ( single) => Some ( QuerySingle {
459+ Ok ( single) => Some ( Single {
462460 item : single,
463461 _filter : PhantomData ,
464462 } ) ,
@@ -489,13 +487,13 @@ unsafe impl<'a, D: QueryData + 'static, F: QueryFilter + 'static> SystemParam
489487
490488// SAFETY: QueryState is constrained to read-only fetches, so it only reads World.
491489unsafe impl < ' a , D : ReadOnlyQueryData + ' static , F : QueryFilter + ' static > ReadOnlySystemParam
492- for QuerySingle < ' a , D , F >
490+ for Single < ' a , D , F >
493491{
494492}
495493
496494// SAFETY: QueryState is constrained to read-only fetches, so it only reads World.
497495unsafe impl < ' a , D : ReadOnlyQueryData + ' static , F : QueryFilter + ' static > ReadOnlySystemParam
498- for Option < QuerySingle < ' a , D , F > >
496+ for Option < Single < ' a , D , F > >
499497{
500498}
501499
0 commit comments