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

@@ -39,7 +39,7 @@ fn compile() -> Result<()> {
assert_eq!(m.imports().len(), 0);
assert_eq!(m.exports().len(), 0);
let bytes = m.serialize()?;
Module::deserialize(&engine, &bytes)?;
Module::new(&engine, &bytes)?;
assert_eq!(m.imports().len(), 0);
assert_eq!(m.exports().len(), 0);
Ok(())