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:
@@ -53,7 +53,7 @@ pub fn check_stacks(stacks: Stacks) -> usize {
|
||||
.expect("should instantiate okay");
|
||||
|
||||
let run = instance
|
||||
.get_typed_func::<(u32,), (), _>(&mut store, "run")
|
||||
.get_typed_func::<(u32,), ()>(&mut store, "run")
|
||||
.expect("should export `run` function");
|
||||
|
||||
let mut max_stack_depth = 0;
|
||||
@@ -62,7 +62,7 @@ pub fn check_stacks(stacks: Stacks) -> usize {
|
||||
if let Err(trap) = run.call(&mut store, (input.into(),)) {
|
||||
log::debug!("trap: {:?}", trap);
|
||||
let get_stack = instance
|
||||
.get_typed_func::<(), (u32, u32), _>(&mut store, "get_stack")
|
||||
.get_typed_func::<(), (u32, u32)>(&mut store, "get_stack")
|
||||
.expect("should export `get_stack` function as expected");
|
||||
|
||||
let (ptr, len) = get_stack
|
||||
|
||||
Reference in New Issue
Block a user