diff --git a/lib/runtime-core/src/instance.rs b/lib/runtime-core/src/instance.rs index c7f2b9f52..48e59d4ec 100644 --- a/lib/runtime-core/src/instance.rs +++ b/lib/runtime-core/src/instance.rs @@ -230,6 +230,23 @@ impl Instance { /// This returns `CallResult>` in order to support /// the future multi-value returns WebAssembly feature. /// + /// Consider using the more explicit [`Exports::get`]` with [`DynFunc::call`] + /// instead. For example: + /// + /// ``` + /// # use wasmer_runtime_core::types::Value; + /// # use wasmer_runtime_core::error::Result; + /// # use wasmer_runtime_core::Instance; + /// # use wasmer_runtime_core::DynFunc; + /// # fn call_foo(instance: &mut Instance) -> Result<()> { + /// // ... + /// let foo: DynFunc = instance.exports.get("foo")?; + /// let results = foo.call(&[Value::I32(42)])?; + /// // ... + /// # Ok(()) + /// # } + /// ``` + /// /// # Usage: /// ``` /// # use wasmer_runtime_core::types::Value; @@ -242,10 +259,6 @@ impl Instance { /// # Ok(()) /// # } /// ``` - #[deprecated( - since = "0.17.0", - note = "Please use `let f: DynFunc = instance.exports.get(name)?; f.call(params)?;` instead" - )] pub fn call(&self, name: &str, params: &[Value]) -> CallResult> { let func: DynFunc = self.exports.get(name)?; func.call(params) diff --git a/lib/runtime-core/src/module.rs b/lib/runtime-core/src/module.rs index 3e9208efa..f9d82f6cb 100644 --- a/lib/runtime-core/src/module.rs +++ b/lib/runtime-core/src/module.rs @@ -180,14 +180,14 @@ impl Module { /// // For example, here we get all the names of the functions exported by this module. /// let function_names = /// module.exports() - /// .filter(|ed| ed.kind == ExportType::Function) + /// .filter(|ed| ed.ty == ExportType::Function) /// .map(|ed| ed.name.to_string()) /// .collect::>(); /// /// // And here we count the number of global variables exported by this module. /// let num_globals = /// module.exports() - /// .filter(|ed| ed.kind == ExportType::Global) + /// .filter(|ed| ed.ty == ExportType::Global) /// .count(); /// # } /// ```