Skip to content

Commit 8dff1b7

Browse files
committed
use std.json.Stringify.value instead of std.json.stringify
1 parent d604e1a commit 8dff1b7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/playground-integration/main.zig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,11 @@ fn sendMessageToWasm(wasm_interface: *const WasmInterface, allocator: std.mem.Al
282282
// Serialize message to JSON
283283
var message_json_buffer = std.array_list.Managed(u8).init(allocator);
284284
defer message_json_buffer.deinit();
285-
try std.json.stringify(message, .{}, message_json_buffer.writer());
285+
var buffer: [1024]u8 = undefined;
286+
var json_writer = message_json_buffer.writer().adaptToNewApi(&buffer).new_interface;
287+
try std.json.Stringify.value(message, .{}, &json_writer);
286288
const message_json = message_json_buffer.items;
289+
try json_writer.flush();
287290

288291
// Allocate a buffer in WASM for the message.
289292
// The WASM module's allocateMessageBuffer export handles this.

0 commit comments

Comments
 (0)