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:
@@ -33,7 +33,7 @@ fn main() -> Result<()> {
|
||||
|
||||
// Extract exports.
|
||||
println!("Extracting export...");
|
||||
let g = instance.get_typed_func::<(i32, i64), (i64, i32), _>(&mut store, "g")?;
|
||||
let g = instance.get_typed_func::<(i32, i64), (i64, i32)>(&mut store, "g")?;
|
||||
|
||||
// Call `$g`.
|
||||
println!("Calling export \"g\"...");
|
||||
@@ -51,7 +51,6 @@ fn main() -> Result<()> {
|
||||
.get_typed_func::<
|
||||
(i64, i64, i64, i64, i64, i64, i64, i64, i64, i64),
|
||||
(i64, i64, i64, i64, i64, i64, i64, i64, i64, i64),
|
||||
_,
|
||||
>
|
||||
(&mut store, "round_trip_many")?;
|
||||
let results = round_trip_many.call(&mut store, (0, 1, 2, 3, 4, 5, 6, 7, 8, 9))?;
|
||||
|
||||
Reference in New Issue
Block a user