Skip to content

Commit

Permalink
value: always alloc when parsing json
Browse files Browse the repository at this point in the history
  • Loading branch information
cztomsik committed Aug 14, 2024
1 parent f5eeb54 commit 87fedb8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/value.zig
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ pub const Value = union(enum) {
.Enum => if (comptime util.isDense(T)) std.meta.stringToEnum(T, self.string) orelse error.InvalidEnumTag else @enumFromInt(self.int),
else => {
if (comptime util.isJsonRepresentable(T)) {
return std.json.parseFromSliceLeaky(T, arena, self.string, .{});
return std.json.parseFromSliceLeaky(T, arena, self.string, .{
.allocate = .alloc_always,
});
}

@compileError("TODO: " ++ @typeName(T));
Expand Down

0 comments on commit 87fedb8

Please sign in to comment.