Skip to content

Commit

Permalink
Update base.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
llogick authored and Techatrix committed Feb 16, 2024
1 parent df0b51b commit f4780cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/base.zig
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub fn EnumCustomStringValues(comptime T: type, comptime contains_empty_enum: bo
}

pub fn jsonParse(allocator: std.mem.Allocator, source: anytype, options: std.json.ParseOptions) std.json.ParseError(@TypeOf(source.*))!T {
const slice = try std.json.parseFromTokenSourceLeaky([]const u8, allocator, source, options);
const slice = try std.json.Value.jsonParse(allocator, source, options);
if (contains_empty_enum and slice.len == 0) return .empty;
return map.get(slice) orelse return .{ .custom_value = slice };
}
Expand Down

0 comments on commit f4780cf

Please sign in to comment.