@@ -9,7 +9,7 @@ use crate::core::indices::TypeIdx;
99use crate :: core:: reader:: span:: Span ;
1010use crate :: core:: reader:: types:: data:: { DataModeActive , DataSegment } ;
1111use crate :: core:: reader:: types:: element:: { ActiveElem , ElemItems , ElemMode , ElemType } ;
12- use crate :: core:: reader:: types:: export:: { Export , ExportDesc } ;
12+ use crate :: core:: reader:: types:: export:: ExportDesc ;
1313use crate :: core:: reader:: types:: global:: { Global , GlobalType } ;
1414use crate :: core:: reader:: types:: {
1515 ExternType , FuncType , ImportSubTypeRelation , MemType , ResultType , TableType ,
@@ -22,6 +22,7 @@ use crate::resumable::{
2222 Dormitory , FreshResumableRef , InvokedResumableRef , Resumable , ResumableRef , RunState ,
2323} ;
2424use crate :: { RefType , RuntimeError , ValidationInfo } ;
25+ use alloc:: borrow:: ToOwned ;
2526use alloc:: collections:: btree_map:: BTreeMap ;
2627use alloc:: string:: String ;
2728use alloc:: sync:: Arc ;
@@ -287,19 +288,17 @@ impl<'b, T: Config> Store<'b, T> {
287288 let export_insts: BTreeMap < String , ExternVal > = module
288289 . exports
289290 . iter ( )
290- . map ( |Export { name , desc } | {
291+ . map ( |export | {
291292 let module_inst = self . modules . get ( module_addr) ;
292- let value = match desc {
293- ExportDesc :: Func ( func_idx) => {
294- ExternVal :: Func ( module_inst. func_addrs [ * func_idx] )
295- }
296- ExportDesc :: Table ( table_idx) => ExternVal :: Table ( table_addrs_mod[ * table_idx] ) ,
297- ExportDesc :: Mem ( mem_idx) => ExternVal :: Mem ( mem_addrs_mod[ * mem_idx] ) ,
293+ let value = match export. desc {
294+ ExportDesc :: Func ( func_idx) => ExternVal :: Func ( module_inst. func_addrs [ func_idx] ) ,
295+ ExportDesc :: Table ( table_idx) => ExternVal :: Table ( table_addrs_mod[ table_idx] ) ,
296+ ExportDesc :: Mem ( mem_idx) => ExternVal :: Mem ( mem_addrs_mod[ mem_idx] ) ,
298297 ExportDesc :: Global ( global_idx) => {
299- ExternVal :: Global ( module_inst. global_addrs [ * global_idx] )
298+ ExternVal :: Global ( module_inst. global_addrs [ global_idx] )
300299 }
301300 } ;
302- ( String :: from ( name) , value)
301+ ( export . name . to_owned ( ) , value)
303302 } )
304303 . collect ( ) ;
305304
0 commit comments