Skip to content

Commit 3e31ab7

Browse files
committed
awd
1 parent 5896536 commit 3e31ab7

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

crates/bevy_ecs/src/query/fetch.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ unsafe impl<'w> Fetch<'w> for EntityFetch<'w> {
571571
/// SAFETY: `ROQueryFetch<Self>` is the same as `QueryFetch<Self>`
572572
unsafe impl<T: Component> WorldQuery for &T {
573573
type ReadOnly = Self;
574-
type State = ReadState<T>;
574+
type State = ComponentIdState<T>;
575575

576576
fn shrink<'wlong: 'wshort, 'wshort>(item: QueryItem<'wlong, Self>) -> QueryItem<'wshort, Self> {
577577
item
@@ -580,15 +580,15 @@ unsafe impl<T: Component> WorldQuery for &T {
580580

581581
/// The [`FetchState`] of `&T`.
582582
#[doc(hidden)]
583-
pub struct ReadState<T> {
583+
pub struct ComponentIdState<T> {
584584
component_id: ComponentId,
585585
marker: PhantomData<T>,
586586
}
587587

588-
impl<T: Component> FetchState for ReadState<T> {
588+
impl<T: Component> FetchState for ComponentIdState<T> {
589589
fn init(world: &mut World) -> Self {
590590
let component_id = world.init_component::<T>();
591-
ReadState {
591+
ComponentIdState {
592592
component_id,
593593
marker: PhantomData,
594594
}
@@ -626,14 +626,14 @@ unsafe impl<T: Component> ReadOnlyWorldQuery for &T {}
626626

627627
impl<'w, T: Component> WorldQueryGats<'w> for &T {
628628
type Fetch = ReadFetch<'w, T>;
629-
type _State = ReadState<T>;
629+
type _State = ComponentIdState<T>;
630630
}
631631

632632
// SAFETY: component access and archetype component access are properly updated to reflect that T is
633633
// read
634634
unsafe impl<'w, T: Component> Fetch<'w> for ReadFetch<'w, T> {
635635
type Item = &'w T;
636-
type State = ReadState<T>;
636+
type State = ComponentIdState<T>;
637637

638638
const IS_DENSE: bool = {
639639
match T::Storage::STORAGE_TYPE {
@@ -646,7 +646,7 @@ unsafe impl<'w, T: Component> Fetch<'w> for ReadFetch<'w, T> {
646646

647647
unsafe fn init(
648648
world: &'w World,
649-
state: &ReadState<T>,
649+
state: &ComponentIdState<T>,
650650
_last_change_tick: u32,
651651
_change_tick: u32,
652652
) -> ReadFetch<'w, T> {
@@ -752,7 +752,7 @@ unsafe impl<'w, T: Component> Fetch<'w> for ReadFetch<'w, T> {
752752
/// SAFETY: access of `&T` is a subset of `&mut T`
753753
unsafe impl<'w, T: Component> WorldQuery for &'w mut T {
754754
type ReadOnly = &'w T;
755-
type State = ReadState<T>;
755+
type State = ComponentIdState<T>;
756756

757757
fn shrink<'wlong: 'wshort, 'wshort>(item: QueryItem<'wlong, Self>) -> QueryItem<'wshort, Self> {
758758
item
@@ -790,14 +790,14 @@ impl<T> Clone for WriteFetch<'_, T> {
790790

791791
impl<'w, T: Component> WorldQueryGats<'w> for &mut T {
792792
type Fetch = WriteFetch<'w, T>;
793-
type _State = ReadState<T>;
793+
type _State = ComponentIdState<T>;
794794
}
795795

796796
/// SAFETY: component access and archetype component access are properly updated to reflect that T is
797797
/// read and write
798798
unsafe impl<'w, T: Component> Fetch<'w> for WriteFetch<'w, T> {
799799
type Item = Mut<'w, T>;
800-
type State = ReadState<T>;
800+
type State = ComponentIdState<T>;
801801

802802
const IS_DENSE: bool = {
803803
match T::Storage::STORAGE_TYPE {
@@ -810,7 +810,7 @@ unsafe impl<'w, T: Component> Fetch<'w> for WriteFetch<'w, T> {
810810

811811
unsafe fn init(
812812
world: &'w World,
813-
state: &ReadState<T>,
813+
state: &ComponentIdState<T>,
814814
last_change_tick: u32,
815815
change_tick: u32,
816816
) -> Self {

0 commit comments

Comments
 (0)