Merge branch 'christof/no_plugin_hotfix' into 'master'

fix compilation of voxygen without plugins

See merge request veloren/veloren!4156
This commit is contained in:
Christof Petig 2023-10-24 21:59:25 +00:00
commit d690f25615
2 changed files with 7 additions and 3 deletions

View File

@ -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"]

View File

@ -245,7 +245,6 @@ impl<V> Concatenate for Vec<V> {
}
}
#[cfg(feature = "plugins")]
impl<K: Eq + Hash, V, S: BuildHasher> Concatenate for hashbrown::HashMap<K, V, S> {
fn concatenate(mut self, b: Self) -> Self {
self.extend(b);
@ -258,6 +257,7 @@ impl<T: Concatenate> Concatenate for Ron<T> {
}
/// This wrapper combines several RON files from multiple sources
#[cfg(feature = "plugins")]
#[derive(Clone)]
pub struct MultiRon<T>(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<PathBuf> {
std::env::current_dir().map_or(None, |path| {