fix: more zig-0.15 API fixes

This commit is contained in:
CJ van den Berg 2025-09-24 22:31:38 +02:00
parent 7886ab288d
commit 7d2eeb68c8
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1376,7 +1376,7 @@ pub fn toJson(cbor_buf: []const u8, json_buf: []u8) (JsonEncodeError || Io.Write
return writer.buffered(); return writer.buffered();
} }
pub fn toJsonWriter(cbor_buf: []const u8, writer: *Io.Writer, options: std.json.StringifyOptions) !void { pub fn toJsonWriter(cbor_buf: []const u8, writer: *Io.Writer, options: std.json.Stringify.Options) !void {
var s: json.Stringify = .{ .writer = writer, .options = options }; var s: json.Stringify = .{ .writer = writer, .options = options };
var iter: []const u8 = cbor_buf; var iter: []const u8 = cbor_buf;
try JsonWriter.jsonWriteValue(&s, &iter); try JsonWriter.jsonWriteValue(&s, &iter);
@ -1414,7 +1414,7 @@ pub fn toJsonPrettyAlloc(a: std.mem.Allocator, cbor_buf: []const u8) (JsonEncode
return buf.toOwnedSlice(); return buf.toOwnedSlice();
} }
pub fn toJsonOptsAlloc(a: std.mem.Allocator, cbor_buf: []const u8, opts: std.json.StringifyOptions) JsonEncodeError![]const u8 { pub fn toJsonOptsAlloc(a: std.mem.Allocator, cbor_buf: []const u8, opts: std.json.Stringify.Options) JsonEncodeError![]const u8 {
var buf = Io.Writer.Allocating.init(a); var buf = Io.Writer.Allocating.init(a);
defer buf.deinit(); defer buf.deinit();
var s: json.Stringify = .{ .writer = &buf.writer, .options = opts }; var s: json.Stringify = .{ .writer = &buf.writer, .options = opts };