Skip to content

Commit dd56d45

Browse files
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
1 parent 7161e9c commit dd56d45

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

crates/bevy_asset/src/io/memory.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ impl Dir {
6060
dir = self.get_or_insert_dir(parent);
6161
}
6262
let key: Box<str> = path.file_name().unwrap().to_string_lossy().into();
63-
let data = dir.0.write().assets.remove(&key);
64-
data
63+
dir.0.write().assets.remove(&key)
6564
}
6665

6766
pub fn insert_meta(&self, path: &Path, value: impl Into<Value>) {

crates/bevy_asset/src/server/info.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,9 @@ impl AssetInfos {
347347

348348
/// Returns `true` if the asset this path points to is still alive
349349
pub(crate) fn is_path_alive<'a>(&self, path: impl Into<AssetPath<'a>>) -> bool {
350-
let path = path.into();
351-
352-
let result = self
353-
.get_path_ids(&path)
350+
self.get_path_ids(&path.into())
354351
.filter_map(|id| self.infos.get(&id))
355-
.any(|info| info.weak_handle.strong_count() > 0);
356-
357-
result
352+
.any(|info| info.weak_handle.strong_count() > 0)
358353
}
359354

360355
/// Returns `true` if the asset at this path should be reloaded

0 commit comments

Comments
 (0)