Skip to content

Commit 1207ba2

Browse files
committed
swap wasm-convert for wasm-encoder::reencode
1 parent be8210a commit 1207ba2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/stubwasi.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::collections::HashMap;
22

33
use anyhow::{bail, Error};
4-
use wasm_convert::IntoValType;
54
use wasm_encoder::{
65
CodeSection, ExportKind, ExportSection, Function, FunctionSection, Instruction as Ins, Module,
76
TypeSection,
@@ -110,11 +109,13 @@ fn make_stub_adapter(_module: &str, stubs: &HashMap<&str, FuncType>) -> Vec<u8>
110109
let mut exports = ExportSection::new();
111110
let mut code = CodeSection::new();
112111

112+
use wasm_encoder::reencode::{Reencode, RoundtripReencoder as R};
113+
113114
for (index, (name, ty)) in stubs.iter().enumerate() {
114115
let index = u32::try_from(index).unwrap();
115116
types.ty().function(
116-
ty.params().iter().map(|&v| IntoValType(v).into()),
117-
ty.results().iter().map(|&v| IntoValType(v).into()),
117+
ty.params().iter().map(|&v| R.val_type(v).unwrap()),
118+
ty.results().iter().map(|&v| R.val_type(v).unwrap()),
118119
);
119120
functions.function(index);
120121
exports.export(name, ExportKind::Func, index);

0 commit comments

Comments
 (0)