doc(host) Fix the `Externals` example (#149)
* doc(host) Fix the `Externals` example The example is missing two things: * `index` is computed but not used, * `check_signature` is never used. This patch tries to fix that. * doc(host) Fix `check_signature` example
This commit is contained in:
parent
c7f9196df6
commit
da558c7ce7
10
src/host.rs
10
src/host.rs
|
@ -189,10 +189,16 @@ impl HostError {
|
|||
/// ))
|
||||
/// }
|
||||
/// };
|
||||
///
|
||||
///
|
||||
/// if !self.check_signature(index, signature) {
|
||||
/// return Err(Error::Instantiation(
|
||||
/// format!("Export {} has a bad signature", field_name)
|
||||
/// ));
|
||||
/// }
|
||||
///
|
||||
/// Ok(FuncInstance::alloc_host(
|
||||
/// Signature::new(&[ValueType::I32, ValueType::I32][..], Some(ValueType::I32)),
|
||||
/// ADD_FUNC_INDEX,
|
||||
/// index,
|
||||
/// ))
|
||||
/// }
|
||||
/// }
|
||||
|
|
Loading…
Reference in New Issue