Code review feedback.

* Move `Module::compile` to `Engine::precompile_module`.
* Remove `Module::deserialize` method.
* Make `Module::serialize` the same format as `Engine::precompile_module`.
* Make `Engine::precompile_module` return a `Vec<u8>`.
* Move the remaining serialization-related code to `serialization.rs`.
This commit is contained in:
Peter Huene
2021-03-31 23:46:30 -07:00
parent abf3bf29f9
commit d1313b1291
10 changed files with 136 additions and 146 deletions

View File

@@ -31,7 +31,7 @@ fn deserialize(buffer: &[u8]) -> Result<()> {
// Compile the wasm binary into an in-memory instance of a `Module`.
println!("Deserialize module...");
let module = Module::deserialize(store.engine(), buffer)?;
let module = Module::new(store.engine(), buffer)?;
// Here we handle the imports of the module, which in this case is our
// `HelloCallback` type and its associated implementation of `Callback.