File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -191,14 +191,14 @@ fn check_wasm_exports(module: &Module) -> VmResult<()> {
191
191
/// When this is not the case, we either have an incompatibility between contract and VM
192
192
/// or a error in the contract.
193
193
fn check_wasm_imports ( module : & Module , supported_imports : & [ & str ] ) -> VmResult < ( ) > {
194
- let required_imports: Vec < ImportEntry > = module
194
+ let required_imports: & [ ImportEntry ] = module
195
195
. import_section ( )
196
- . map_or ( vec ! [ ] , |import_section| import_section. entries ( ) . to_vec ( ) ) ;
196
+ . map_or ( & [ ] , |import_section| import_section. entries ( ) ) ;
197
197
let required_import_names: BTreeSet < _ > =
198
198
required_imports. iter ( ) . map ( full_import_name) . collect ( ) ;
199
199
200
200
for required_import in required_imports {
201
- let full_name = full_import_name ( & required_import) ;
201
+ let full_name = full_import_name ( required_import) ;
202
202
if !supported_imports. contains ( & full_name. as_str ( ) ) {
203
203
return Err ( VmError :: static_validation_err ( format ! (
204
204
"Wasm contract requires unsupported import: \" {}\" . Required imports: {}. Available imports: {:?}." ,
You can’t perform that action at this time.
0 commit comments