From b7bad053f4553f86d36c4277dbf1a1b9b14bc535 Mon Sep 17 00:00:00 2001 From: Brian Merchant Date: Sat, 10 Dec 2022 14:15:00 -0800 Subject: [PATCH] Clippy + fmt. --- src/change_detection.rs | 18 +----------------- src/multiple_read.rs | 1 - src/one.rs | 2 ++ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/change_detection.rs b/src/change_detection.rs index ea50276..8cbacbe 100644 --- a/src/change_detection.rs +++ b/src/change_detection.rs @@ -1,17 +1,7 @@ -use crate::{TraitImplRegistry, TraitQuery, TraitQueryState}; -use bevy::ecs::archetype::{Archetype, ArchetypeComponentId}; -use bevy::ecs::component::{ComponentId, ComponentTicks}; +use bevy::ecs::component::ComponentTicks; use bevy::prelude::DetectChanges; -use std::cell::UnsafeCell; -use std::marker::PhantomData; use std::ops::{Deref, DerefMut}; -use bevy::ecs::entity::Entity; -use bevy::ecs::query::{Access, FilteredAccess, ReadOnlyWorldQuery, WorldQuery}; -use bevy::ecs::storage::{ComponentSparseSet, SparseSets, Table}; -use bevy::ecs::world::World; -use bevy::ptr::{ThinSlicePtr, UnsafeCellDeref}; - /// Unique mutable borrow of an entity's component pub struct Mut<'a, T: ?Sized> { pub(crate) value: &'a mut T, @@ -113,9 +103,3 @@ impl AsMut for Mut<'_, T> { self.deref_mut() } } - -pub(crate) enum ChangeDetectionMode { - None, - Added, - Changed -} \ No newline at end of file diff --git a/src/multiple_read.rs b/src/multiple_read.rs index d64af38..2b8547f 100644 --- a/src/multiple_read.rs +++ b/src/multiple_read.rs @@ -3,7 +3,6 @@ use bevy::ecs::component::ComponentId; use bevy::ecs::entity::Entity; use bevy::ecs::storage::{SparseSets, Table}; use bevy::ptr::UnsafeCellDeref; -use std::ops::Deref; /// Read-access to all components implementing a trait for a given entity. pub struct ReadTraits<'a, Trait: ?Sized + TraitQuery> { diff --git a/src/one.rs b/src/one.rs index 792c35b..e713574 100644 --- a/src/one.rs +++ b/src/one.rs @@ -16,6 +16,8 @@ pub struct ReadTraitFetch<'w, Trait: ?Sized> { // After `Fetch::set_archetype` or `set_table` has been called, // this will carry the component data and metadata for the first trait impl found in the archetype. storage: ReadStorage<'w, Trait>, + last_change_tick: u32, + change_tick: u32, } enum ReadStorage<'w, Trait: ?Sized> {