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:
@@ -59,7 +59,7 @@ fn run(
|
||||
|
||||
let mut store = Store::new(&engine, builder.build());
|
||||
let instance = linker.instantiate(&mut store, &module)?;
|
||||
let start = instance.get_typed_func::<(), (), _>(&mut store, "_start")?;
|
||||
let start = instance.get_typed_func::<(), ()>(&mut store, "_start")?;
|
||||
start.call(&mut store, ()).map_err(anyhow::Error::from)
|
||||
};
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ fn run(
|
||||
let mut store = Store::new(&engine, builder.build());
|
||||
|
||||
let instance = linker.instantiate_async(&mut store, &module).await?;
|
||||
let start = instance.get_typed_func::<(), (), _>(&mut store, "_start")?;
|
||||
let start = instance.get_typed_func::<(), ()>(&mut store, "_start")?;
|
||||
start
|
||||
.call_async(&mut store, ())
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user