diff --git a/crates/bevy_app/src/app.rs b/crates/bevy_app/src/app.rs index 7b57f321e07e12..3eb571c3ca9c97 100644 --- a/crates/bevy_app/src/app.rs +++ b/crates/bevy_app/src/app.rs @@ -1,6 +1,7 @@ use crate::{First, Main, MainSchedulePlugin, Plugin, Plugins, StateTransition}; pub use bevy_derive::AppLabel; use bevy_ecs::{ + intern::Interned, prelude::*, schedule::{ common_conditions::run_once as run_once_condition, run_enter_schedule, @@ -8,7 +9,7 @@ use bevy_ecs::{ }, system::SystemId, }; -use bevy_utils::{intern::Interned, tracing::debug, HashMap, HashSet}; +use bevy_utils::{tracing::debug, HashMap, HashSet}; use std::{ fmt::Debug, panic::{catch_unwind, resume_unwind, AssertUnwindSafe}, @@ -18,13 +19,13 @@ use thiserror::Error; #[cfg(feature = "trace")] use bevy_utils::tracing::info_span; -bevy_utils::define_label!( +bevy_ecs::define_label!( /// A strongly-typed class of labels used to identify an [`App`]. AppLabel, APP_LABEL_INTERNER ); -pub use bevy_utils::label::DynEq; +pub use bevy_ecs::label::DynEq; /// A shorthand for `Interned`. pub type InternedAppLabel = Interned; diff --git a/crates/bevy_utils/src/intern.rs b/crates/bevy_ecs/src/intern.rs similarity index 99% rename from crates/bevy_utils/src/intern.rs rename to crates/bevy_ecs/src/intern.rs index 05c4834c97af63..54ea4e32071bc9 100644 --- a/crates/bevy_utils/src/intern.rs +++ b/crates/bevy_ecs/src/intern.rs @@ -11,7 +11,7 @@ use std::{ sync::{OnceLock, PoisonError, RwLock}, }; -use crate::HashSet; +use bevy_utils::HashSet; /// An interned value. Will stay valid until the end of the program and will not drop. /// @@ -26,7 +26,7 @@ use crate::HashSet; // NOTE: This type must NEVER implement Borrow since it does not obey that trait's invariants. /// /// ``` -/// # use bevy_utils::intern::*; +/// # use bevy_ecs::intern::*; /// #[derive(PartialEq, Eq, Hash, Debug)] /// struct Value(i32); /// impl Internable for Value { diff --git a/crates/bevy_utils/src/label.rs b/crates/bevy_ecs/src/label.rs similarity index 97% rename from crates/bevy_utils/src/label.rs rename to crates/bevy_ecs/src/label.rs index b3197f4f54c4cb..6d03c0ca9d3484 100644 --- a/crates/bevy_utils/src/label.rs +++ b/crates/bevy_ecs/src/label.rs @@ -63,7 +63,7 @@ where /// # Example /// /// ``` -/// # use bevy_utils::define_label; +/// # use bevy_ecs::define_label; /// define_label!( /// /// Documentation of label trait /// MyNewLabelTrait, @@ -125,7 +125,7 @@ macro_rules! define_label { /// Feeds this value into the given [`Hasher`]. fn dyn_hash(&self, state: &mut dyn ::std::hash::Hasher); - /// Returns an [`Interned`](bevy_utils::intern::Interned) value corresponding to `self`. + /// Returns an [`Interned`](bevy_ecs::intern::Interned) value corresponding to `self`. fn intern(&self) -> $crate::intern::Interned where Self: Sized { $interner_name.intern(self) diff --git a/crates/bevy_ecs/src/lib.rs b/crates/bevy_ecs/src/lib.rs index 4626fbd6c2d07b..7eb5cf1a3bd1bd 100644 --- a/crates/bevy_ecs/src/lib.rs +++ b/crates/bevy_ecs/src/lib.rs @@ -18,6 +18,8 @@ pub mod component; pub mod entity; pub mod event; pub mod identifier; +pub mod intern; +pub mod label; pub mod query; #[cfg(feature = "bevy_reflect")] pub mod reflect; diff --git a/crates/bevy_ecs/src/schedule/set.rs b/crates/bevy_ecs/src/schedule/set.rs index d1ee7badfaa8e4..10d48aae1d8446 100644 --- a/crates/bevy_ecs/src/schedule/set.rs +++ b/crates/bevy_ecs/src/schedule/set.rs @@ -3,14 +3,16 @@ use std::fmt::Debug; use std::hash::{Hash, Hasher}; use std::marker::PhantomData; +pub use crate::label::DynEq; pub use bevy_ecs_macros::{ScheduleLabel, SystemSet}; -use bevy_utils::define_label; -use bevy_utils::intern::Interned; -pub use bevy_utils::label::DynEq; -use crate::system::{ - ExclusiveFunctionSystem, ExclusiveSystemParamFunction, FunctionSystem, - IsExclusiveFunctionSystem, IsFunctionSystem, SystemParamFunction, +use crate::{ + define_label, + intern::Interned, + system::{ + ExclusiveFunctionSystem, ExclusiveSystemParamFunction, FunctionSystem, + IsExclusiveFunctionSystem, IsFunctionSystem, SystemParamFunction, + }, }; define_label!( diff --git a/crates/bevy_render/src/render_graph/graph.rs b/crates/bevy_render/src/render_graph/graph.rs index daef5bbf2458c6..a919ba49309b5e 100644 --- a/crates/bevy_render/src/render_graph/graph.rs +++ b/crates/bevy_render/src/render_graph/graph.rs @@ -5,8 +5,8 @@ use crate::{ }, renderer::RenderContext, }; -use bevy_ecs::{prelude::World, system::Resource}; -use bevy_utils::{define_label, intern::Interned, HashMap}; +use bevy_ecs::{define_label, intern::Interned, prelude::World, system::Resource}; +use bevy_utils::HashMap; use std::fmt::Debug; use super::{EdgeExistence, InternedRenderLabel, IntoRenderNodeArray}; diff --git a/crates/bevy_render/src/render_graph/node.rs b/crates/bevy_render/src/render_graph/node.rs index 577071759ce9c3..0558f7c0781642 100644 --- a/crates/bevy_render/src/render_graph/node.rs +++ b/crates/bevy_render/src/render_graph/node.rs @@ -5,12 +5,14 @@ use crate::{ }, renderer::RenderContext, }; +pub use bevy_ecs::label::DynEq; use bevy_ecs::{ + define_label, + intern::Interned, query::{QueryItem, QueryState, ReadOnlyQueryData}, world::{FromWorld, World}, }; -pub use bevy_utils::label::DynEq; -use bevy_utils::{all_tuples_with_size, define_label, intern::Interned}; +use bevy_utils::all_tuples_with_size; use downcast_rs::{impl_downcast, Downcast}; use std::fmt::Debug; use thiserror::Error; diff --git a/crates/bevy_utils/src/lib.rs b/crates/bevy_utils/src/lib.rs index 04325b64fe8054..891b2734fe6d29 100644 --- a/crates/bevy_utils/src/lib.rs +++ b/crates/bevy_utils/src/lib.rs @@ -16,7 +16,6 @@ pub mod prelude { } pub mod futures; -pub mod label; mod short_names; pub use short_names::get_short_name; pub mod synccell; @@ -24,7 +23,6 @@ pub mod syncunsafecell; mod cow_arc; mod default; -pub mod intern; mod once; mod parallel_queue;