Skip to content

Commit

Permalink
[Rust] fix length calculation in stream.write bindings
Browse files Browse the repository at this point in the history
When calculating the length we pass to the `stream.write` intrinsic, we need to
subtract the number of bytes we've already written.  I forgot to do that in my
original PR.

Signed-off-by: Joel Dice <[email protected]>
  • Loading branch information
dicej committed Feb 6, 2025
1 parent f2393e6 commit 880d199
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/rust/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ pub mod vtable{ordinal} {{
wit_import,
stream,
address.add(total * {size}),
u32::try_from(values.len()).unwrap()
u32::try_from(values.len() - (total * {size})).unwrap()
).await
}};
Expand Down

0 comments on commit 880d199

Please sign in to comment.