Skip to content

Commit 20dd2c4

Browse files
committed
Remove unnecessary vector clone
1 parent 1ca24b2 commit 20dd2c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/vm/src/compatibility.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,14 @@ fn check_wasm_exports(module: &Module) -> VmResult<()> {
191191
/// When this is not the case, we either have an incompatibility between contract and VM
192192
/// or a error in the contract.
193193
fn check_wasm_imports(module: &Module, supported_imports: &[&str]) -> VmResult<()> {
194-
let required_imports: Vec<ImportEntry> = module
194+
let required_imports: &[ImportEntry] = module
195195
.import_section()
196-
.map_or(vec![], |import_section| import_section.entries().to_vec());
196+
.map_or(&[], |import_section| import_section.entries());
197197
let required_import_names: BTreeSet<_> =
198198
required_imports.iter().map(full_import_name).collect();
199199

200200
for required_import in required_imports {
201-
let full_name = full_import_name(&required_import);
201+
let full_name = full_import_name(required_import);
202202
if !supported_imports.contains(&full_name.as_str()) {
203203
return Err(VmError::static_validation_err(format!(
204204
"Wasm contract requires unsupported import: \"{}\". Required imports: {}. Available imports: {:?}.",

0 commit comments

Comments
 (0)