Remove explicit S type parameters (#5275)
* Remove explicit `S` type parameters This commit removes the explicit `S` type parameter on `Func::typed` and `Instance::get_typed_func`. Historical versions of Rust required that this be a type parameter but recent rustcs support a mixture of explicit type parameters and `impl Trait`. This removes, at callsites, a superfluous `, _` argument which otherwise never needs specification. * Fix mdbook examples
This commit is contained in:
@@ -20,9 +20,9 @@ fn main() -> Result<()> {
|
||||
let memory = instance
|
||||
.get_memory(&mut store, "memory")
|
||||
.ok_or(anyhow::format_err!("failed to find `memory` export"))?;
|
||||
let size = instance.get_typed_func::<(), i32, _>(&mut store, "size")?;
|
||||
let load_fn = instance.get_typed_func::<i32, i32, _>(&mut store, "load")?;
|
||||
let store_fn = instance.get_typed_func::<(i32, i32), (), _>(&mut store, "store")?;
|
||||
let size = instance.get_typed_func::<(), i32>(&mut store, "size")?;
|
||||
let load_fn = instance.get_typed_func::<i32, i32>(&mut store, "load")?;
|
||||
let store_fn = instance.get_typed_func::<(i32, i32), ()>(&mut store, "store")?;
|
||||
|
||||
println!("Checking memory...");
|
||||
assert_eq!(memory.size(&store), 2);
|
||||
|
||||
Reference in New Issue
Block a user