File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ use bevy_ecs::{error::BevyError, world::World};
1212use bevy_platform:: collections:: { hash_map:: Entry , HashMap , HashSet } ;
1313use bevy_reflect:: TypePath ;
1414use bevy_tasks:: { BoxedFuture , ConditionalSendFuture } ;
15- use core:: any:: { Any , TypeId } ;
15+ use core:: {
16+ any:: { Any , TypeId } ,
17+ convert:: Infallible ,
18+ } ;
1619use downcast_rs:: { impl_downcast, Downcast } ;
1720use ron:: error:: SpannedError ;
1821use serde:: { Deserialize , Serialize } ;
@@ -475,8 +478,8 @@ impl<'a> LoadContext<'a> {
475478 label : impl Into < CowArc < ' static , str > > ,
476479 asset : A ,
477480 ) -> Handle < A > {
478- self . labeled_asset_scope ( label, |_| Ok :: < _ , ( ) > ( asset) )
479- . expect ( "the closure returns Ok" )
481+ let Ok ( handle ) = self . labeled_asset_scope ( label, |_| Ok :: < _ , Infallible > ( asset) ) ;
482+ handle
480483 }
481484
482485 /// Add a [`LoadedAsset`] that is a "labeled sub asset" of the root path of this load context.
You can’t perform that action at this time.
0 commit comments