Skip to content

Commit

Permalink
fix: Update to work with Zig master
Browse files Browse the repository at this point in the history
  • Loading branch information
mochalins committed Aug 31, 2024
1 parent 193a210 commit 55dadf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parser.zig
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ pub fn EnumCustomStringValues(comptime T: type, comptime contains_empty_enum: bo

const kvs = build_kvs: {
const KV = struct { []const u8, T };
const fields = @typeInfo(T).Union.fields;
const fields = std.meta.fields(T);
var kvs_array: [fields.len - 1]KV = undefined;
for (fields[0 .. fields.len - 1], &kvs_array) |field, *kv| {
if (contains_empty_enum and std.mem.eql(u8, field.name, "empty")) {
Expand Down Expand Up @@ -362,7 +362,7 @@ fn expectParseEqual(comptime T: type, comptime expected: anytype, s: []const u8)
defer arena_allocator.deinit();
const arena = arena_allocator.allocator();

if (@typeInfo(@TypeOf(expected)) != .ErrorSet) {
if (@typeInfo(@TypeOf(expected)) != .error_set) {
const actual_from_slice = try std.json.parseFromSliceLeaky(T, arena, s, .{});
try std.testing.expectEqualDeep(@as(T, expected), actual_from_slice);

Expand Down

0 comments on commit 55dadf1

Please sign in to comment.