diff --git a/crates/bevy_asset/src/assets.rs b/crates/bevy_asset/src/assets.rs index 88a12226d4eff..a90afe5f20803 100644 --- a/crates/bevy_asset/src/assets.rs +++ b/crates/bevy_asset/src/assets.rs @@ -186,12 +186,12 @@ impl Assets { /// Get a mutable iterator over all assets in the collection. pub fn iter_mut(&mut self) -> impl Iterator { - for id in self.assets.keys() { + self.assets.iter_mut().map(|(k, v)| { self.events.send(AssetEvent::Modified { - handle: Handle::weak(*id), + handle: Handle::weak(*k), }); - } - self.assets.iter_mut().map(|(k, v)| (*k, v)) + (*k, v) + }) } /// Get an iterator over all [`HandleId`]'s in the collection.