diff --git a/common/assets/Cargo.toml b/common/assets/Cargo.toml index 2ab9f976b0..d4a604ec0b 100644 --- a/common/assets/Cargo.toml +++ b/common/assets/Cargo.toml @@ -14,10 +14,10 @@ wavefront = "0.2" # TODO: Use vertex-colors branch when we have models that have image = { workspace = true } tracing = { workspace = true } tar = { version = "0.4.37", optional = true } +hashbrown = { workspace = true } # asset tweak serde = { workspace = true, optional = true } -hashbrown = { workspace = true, optional = true } [dev-dependencies] walkdir = "2.3.2" @@ -25,4 +25,4 @@ walkdir = "2.3.2" [features] hot-reloading = ["assets_manager/hot-reloading"] asset_tweak = ["dep:serde", "hot-reloading"] -plugins = ["dep:serde", "dep:tar", "dep:hashbrown"] +plugins = ["dep:serde", "dep:tar"] diff --git a/common/assets/src/lib.rs b/common/assets/src/lib.rs index 7416fb870a..f2e7eb9ece 100644 --- a/common/assets/src/lib.rs +++ b/common/assets/src/lib.rs @@ -245,7 +245,6 @@ impl Concatenate for Vec { } } -#[cfg(feature = "plugins")] impl Concatenate for hashbrown::HashMap { fn concatenate(mut self, b: Self) -> Self { self.extend(b); @@ -258,6 +257,7 @@ impl Concatenate for Ron { } /// This wrapper combines several RON files from multiple sources +#[cfg(feature = "plugins")] #[derive(Clone)] pub struct MultiRon(pub T); @@ -273,6 +273,10 @@ where } } +// fallback +#[cfg(not(feature = "plugins"))] +pub use assets_manager::asset::Ron as MultiRon; + /// Return path to repository root by searching 10 directories back pub fn find_root() -> Option { std::env::current_dir().map_or(None, |path| {