From 7db0d83c19932840345fc3291f8d0d6e4c07cf76 Mon Sep 17 00:00:00 2001 From: Zachary Harrold Date: Mon, 24 Mar 2025 09:05:12 +1100 Subject: [PATCH] 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 --- crates/bevy_asset/src/io/memory.rs | 3 +-- crates/bevy_asset/src/server/info.rs | 9 ++------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/crates/bevy_asset/src/io/memory.rs b/crates/bevy_asset/src/io/memory.rs index 5b9e5389c2..18ac524ca0 100644 --- a/crates/bevy_asset/src/io/memory.rs +++ b/crates/bevy_asset/src/io/memory.rs @@ -60,8 +60,7 @@ impl Dir { dir = self.get_or_insert_dir(parent); } let key: Box = path.file_name().unwrap().to_string_lossy().into(); - let data = dir.0.write().assets.remove(&key); - data + dir.0.write().assets.remove(&key) } pub fn insert_meta(&self, path: &Path, value: impl Into) { diff --git a/crates/bevy_asset/src/server/info.rs b/crates/bevy_asset/src/server/info.rs index e519bf86ae..66a4fab23a 100644 --- a/crates/bevy_asset/src/server/info.rs +++ b/crates/bevy_asset/src/server/info.rs @@ -347,14 +347,9 @@ impl AssetInfos { /// Returns `true` if the asset this path points to is still alive pub(crate) fn is_path_alive<'a>(&self, path: impl Into>) -> bool { - let path = path.into(); - - let result = self - .get_path_ids(&path) + self.get_path_ids(&path.into()) .filter_map(|id| self.infos.get(&id)) - .any(|info| info.weak_handle.strong_count() > 0); - - result + .any(|info| info.weak_handle.strong_count() > 0) } /// Returns `true` if the asset at this path should be reloaded