From d42a982319b89196ea4937d070ab82afbc977788 Mon Sep 17 00:00:00 2001 From: jd Date: Fri, 19 May 2023 10:09:40 +0200 Subject: [PATCH] Fix breaking change introduced on json API (https://github.com/ziglang/zig/pull/15705) --- src/main.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.zig b/src/main.zig index ffee5dba..a608569a 100644 --- a/src/main.zig +++ b/src/main.zig @@ -137,11 +137,11 @@ pub fn main() !void { const ZigEnv = struct { lib_dir: []const u8, }; - var json_token_stream = std.json.TokenStream.init(result.stdout); - const zig_env = try std.json.parse(ZigEnv, &json_token_stream, .{ - .allocator = arena, + const zig_env = try std.json.parseFromSlice(ZigEnv, arena, result.stdout, .{ .ignore_unknown_fields = true, }); + defer std.json.parseFree(ZigEnv, arena, zig_env); + const sys_include = try fs.path.join(arena, &.{ zig_env.lib_dir, "include" }); var in_dir = try fs.cwd().openDir(in_path, .{});