Update assets_manager to 0.6.0

This commit is contained in:
Benoît du Garreau 2021-10-01 21:12:22 +02:00
parent f7161c1859
commit ef1c51332d
5 changed files with 7 additions and 10 deletions

4
Cargo.lock generated
View File

@ -214,9 +214,9 @@ dependencies = [
[[package]] [[package]]
name = "assets_manager" name = "assets_manager"
version = "0.5.0" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f17769d44fe3eee8cdc255520183fee4e76b30f105de6431cd034e1d7a6f0499" checksum = "1091e796450c5caa4bf1b05e4c17581291a281652e2faa870d2f1a64d51e7436"
dependencies = [ dependencies = [
"ahash 0.7.4", "ahash 0.7.4",
"bincode", "bincode",

View File

@ -7,7 +7,7 @@ version = "0.10.0"
[dependencies] [dependencies]
lazy_static = "1.4.0" lazy_static = "1.4.0"
assets_manager = {version = "0.5.0", features = ["bincode", "ron", "json"]} assets_manager = {version = "0.6.0", features = ["bincode", "ron", "json"]}
ron = { version = "0.6", default-features = false } ron = { version = "0.6", default-features = false }
dot_vox = "4.0" dot_vox = "4.0"
image = { version = "0.23.12", default-features = false, features = ["png"] } image = { version = "0.23.12", default-features = false, features = ["png"] }

View File

@ -101,10 +101,6 @@ pub trait AssetExt: Sized + Send + Sync + 'static {
/// Loads directory and all files in it /// Loads directory and all files in it
/// ///
/// NOTE: If you call `.iter()` on it, all failed files will be ignored
/// If you want to handle errors, call `.ids()` which will return
/// iterator over assets specifiers
///
/// # Errors /// # Errors
/// An error is returned if the given id does not match a valid readable /// An error is returned if the given id does not match a valid readable
/// directory. /// directory.

View File

@ -625,7 +625,6 @@ impl Item {
pub fn new_from_asset_glob(asset_glob: &str) -> Result<Vec<Self>, Error> { pub fn new_from_asset_glob(asset_glob: &str) -> Result<Vec<Self>, Error> {
let specifier = asset_glob.strip_suffix(".*").unwrap_or(asset_glob); let specifier = asset_glob.strip_suffix(".*").unwrap_or(asset_glob);
let defs = assets::load_dir::<RawItemDef>(specifier, true)?; let defs = assets::load_dir::<RawItemDef>(specifier, true)?;
// use ids() instead of iter() because we don't want to ignore errors
defs.ids().map(Item::new_from_asset).collect() defs.ids().map(Item::new_from_asset).collect()
} }

View File

@ -118,9 +118,11 @@ impl common_assets::Compound for Language {
.ids() .ids()
{ {
// Don't try to load manifests // Don't try to load manifests
if id.ends_with(&[".", LANG_MANIFEST_FILE].concat()) { if let Some(id) = id.strip_suffix(LANG_MANIFEST_FILE) {
if id.ends_with('.') {
continue; continue;
} }
}
match cache.load(id) { match cache.load(id) {
Ok(handle) => { Ok(handle) => {