Skip to content

Commit

Permalink
rn module_ref()
Browse files Browse the repository at this point in the history
  • Loading branch information
yurydelendik committed May 26, 2020
1 parent d47371f commit 1e94ec4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crates/jit/src/instantiate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ impl CompiledModule {
}

/// Return a reference to a module.
pub fn module_ref(&self) -> &Module {
pub fn module(&self) -> &Module {
&self.module
}

Expand Down
4 changes: 2 additions & 2 deletions crates/wasmtime/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ fn instantiate(
}
}

if imports.len() != compiled_module.module_ref().imports.len() {
if imports.len() != compiled_module.module().imports.len() {
bail!(
"wrong number of imports provided, {} != {}",
imports.len(),
compiled_module.module_ref().imports.len()
compiled_module.module().imports.len()
);
}

Expand Down
6 changes: 3 additions & 3 deletions crates/wasmtime/src/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ impl Module {
pub fn imports<'module>(
&'module self,
) -> impl ExactSizeIterator<Item = ImportType<'module>> + 'module {
let module = self.inner.compiled.module_ref();
let module = self.inner.compiled.module();
module
.imports
.iter()
Expand Down Expand Up @@ -484,7 +484,7 @@ impl Module {
pub fn exports<'module>(
&'module self,
) -> impl ExactSizeIterator<Item = ExportType<'module>> + 'module {
let module = self.inner.compiled.module_ref();
let module = self.inner.compiled.module();
module.exports.iter().map(move |(name, entity_index)| {
let r#type = EntityType::new(entity_index, module);
ExportType::new(name, r#type)
Expand Down Expand Up @@ -535,7 +535,7 @@ impl Module {
/// # }
/// ```
pub fn get_export<'module>(&'module self, name: &'module str) -> Option<ExternType> {
let module = self.inner.compiled.module_ref();
let module = self.inner.compiled.module();
let entity_index = module.exports.get(name)?;
Some(EntityType::new(entity_index, module).extern_type())
}
Expand Down

0 comments on commit 1e94ec4

Please sign in to comment.