Skip to content

Commit 880d199

Browse files
committed
[Rust] fix length calculation in stream.write bindings
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]>
1 parent f2393e6 commit 880d199

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/rust/src/interface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ pub mod vtable{ordinal} {{
795795
wit_import,
796796
stream,
797797
address.add(total * {size}),
798-
u32::try_from(values.len()).unwrap()
798+
u32::try_from(values.len() - (total * {size})).unwrap()
799799
).await
800800
}};
801801

0 commit comments

Comments
 (0)