Address lints in bevy_asset
(#18502)
# Objective `cargo clippy -p bevy_asset` warns on a pair of lints on my Windows 10 development machine (return from let binding). ## Solution Addressed them! ## Testing - CI
This commit is contained in:
parent
0f52a2816d
commit
7db0d83c19
@ -60,8 +60,7 @@ impl Dir {
|
|||||||
dir = self.get_or_insert_dir(parent);
|
dir = self.get_or_insert_dir(parent);
|
||||||
}
|
}
|
||||||
let key: Box<str> = path.file_name().unwrap().to_string_lossy().into();
|
let key: Box<str> = path.file_name().unwrap().to_string_lossy().into();
|
||||||
let data = dir.0.write().assets.remove(&key);
|
dir.0.write().assets.remove(&key)
|
||||||
data
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn insert_meta(&self, path: &Path, value: impl Into<Value>) {
|
pub fn insert_meta(&self, path: &Path, value: impl Into<Value>) {
|
||||||
|
@ -347,14 +347,9 @@ impl AssetInfos {
|
|||||||
|
|
||||||
/// Returns `true` if the asset this path points to is still alive
|
/// Returns `true` if the asset this path points to is still alive
|
||||||
pub(crate) fn is_path_alive<'a>(&self, path: impl Into<AssetPath<'a>>) -> bool {
|
pub(crate) fn is_path_alive<'a>(&self, path: impl Into<AssetPath<'a>>) -> bool {
|
||||||
let path = path.into();
|
self.get_path_ids(&path.into())
|
||||||
|
|
||||||
let result = self
|
|
||||||
.get_path_ids(&path)
|
|
||||||
.filter_map(|id| self.infos.get(&id))
|
.filter_map(|id| self.infos.get(&id))
|
||||||
.any(|info| info.weak_handle.strong_count() > 0);
|
.any(|info| info.weak_handle.strong_count() > 0)
|
||||||
|
|
||||||
result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns `true` if the asset at this path should be reloaded
|
/// Returns `true` if the asset at this path should be reloaded
|
||||||
|
Loading…
Reference in New Issue
Block a user