Skip to content

Commit

Permalink
Fix result tuple extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
vigoo committed Feb 22, 2024
1 parent 6918e3e commit 8017fcf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wasm-rpc-stubgen/src/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ fn generate_function_stub_source(
output_values.push(extract_from_wit_value(
typ,
&def.resolve,
quote! { result },
quote! { result.tuple_element(0).expect("tuple not found") },
)?);
}
FunctionResultStub::Multi(params) => {
Expand All @@ -303,7 +303,7 @@ fn generate_function_stub_source(
FunctionResultStub::SelfType if mode == FunctionMode::Constructor => {
output_values.push(quote! {
{
let (uri, id) = result.handle().expect("handle not found");
let (uri, id) = result.tuple_element(0).expect("tuple not found").handle().expect("handle not found");
Self {
rpc,
id,
Expand Down

0 comments on commit 8017fcf

Please sign in to comment.