Tweak the API of the Val type (#679)
* Tweak the API of the `Val` type A few updates to the API of the `Val` type: * Added a payload for `V128`. * Replace existing accessor methods with `Option`-returning versions. * Add `unwrap_xxx` family of methods to extract a value and panic. * Remove `Into` conversions which panic, since panicking in `From` or `Into` isn't idiomatic in Rust * Add documentation to all methods/values/enums/etc. * Rename `Val::default` to `Val::null` * Run rustfmt * Review comments
This commit is contained in:
@@ -51,7 +51,7 @@ macro_rules! call {
|
||||
($func:expr, $($p:expr),*) => {
|
||||
match $func.borrow().call(&[$($p.into()),*]) {
|
||||
Ok(result) => {
|
||||
let result: i32 = result[0].clone().into();
|
||||
let result: i32 = result[0].unwrap_i32();
|
||||
result
|
||||
}
|
||||
Err(_) => { bail!("> Error on result, expected return"); }
|
||||
|
||||
Reference in New Issue
Block a user