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
|
@ -190,9 +190,15 @@ impl HostError {
|
||||||
/// }
|
/// }
|
||||||
/// };
|
/// };
|
||||||
///
|
///
|
||||||
|
/// if !self.check_signature(index, signature) {
|
||||||
|
/// return Err(Error::Instantiation(
|
||||||
|
/// format!("Export {} has a bad signature", field_name)
|
||||||
|
/// ));
|
||||||
|
/// }
|
||||||
|
///
|
||||||
/// Ok(FuncInstance::alloc_host(
|
/// Ok(FuncInstance::alloc_host(
|
||||||
/// Signature::new(&[ValueType::I32, ValueType::I32][..], Some(ValueType::I32)),
|
/// Signature::new(&[ValueType::I32, ValueType::I32][..], Some(ValueType::I32)),
|
||||||
/// ADD_FUNC_INDEX,
|
/// index,
|
||||||
/// ))
|
/// ))
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
|
|
Loading…
Reference in New Issue