@@ -246,6 +246,10 @@ pub(crate) fn extract_render_asset<A: RenderAsset>(
246
246
let mut modified = <HashSet < _ > >:: default ( ) ;
247
247
248
248
for event in events. read ( ) {
249
+ #[ expect(
250
+ clippy:: match_same_arms,
251
+ reason = "LoadedWithDependencies is marked as a TODO, so it's likely this will no longer lint soon."
252
+ ) ]
249
253
match event {
250
254
AssetEvent :: Added { id } => {
251
255
needs_extracting. insert ( * id) ;
@@ -254,20 +258,9 @@ pub(crate) fn extract_render_asset<A: RenderAsset>(
254
258
needs_extracting. insert ( * id) ;
255
259
modified. insert ( * id) ;
256
260
}
257
- AssetEvent :: Removed { id, .. } => {
258
- // Normally, we consider an asset removed from the render world only
259
- // when it's final handle is dropped triggering an `AssetEvent::Unused`
260
- // event. However, removal without unused can happen when the asset
261
- // is explicitly removed from the asset server and re-added by the user.
262
- // We mark the asset as modified in this case to ensure that
263
- // any necessary render world bookkeeping still runs.
264
-
265
- // TODO: consider removing this check and just emitting Unused after
266
- // Removed to ensure that the asset is always "really" removed from the
267
- // render world when the last strong handle is dropped.
268
- if !removed. contains ( id) {
269
- modified. insert ( * id) ;
270
- }
261
+ AssetEvent :: Removed { .. } => {
262
+ // We don't care that the asset was removed from Assets<T> in the main world.
263
+ // An asset is only removed from RenderAssets<T> when its last handle is dropped (AssetEvent::Unused).
271
264
}
272
265
AssetEvent :: Unused { id } => {
273
266
needs_extracting. remove ( id) ;
0 commit comments