Skip to content

Commit

Permalink
value: fix .into(bool)
Browse files Browse the repository at this point in the history
  • Loading branch information
cztomsik committed Aug 14, 2024
1 parent 5d180f8 commit 1506761
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/value.zig
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub const Value = union(enum) {

return switch (@typeInfo(T)) {
.Optional => |o| if (self == .null) null else try into(self, o.child, arena),
.Bool => if (self.int) true else false,
.Bool => if (self.int == 1) true else false,
.Int, .ComptimeInt => @intCast(self.int),
.Float, .ComptimeFloat => @floatCast(self.float),
.Enum => if (comptime util.isDense(T)) std.meta.stringToEnum(T, self.string) orelse error.InvalidEnumTag else @enumFromInt(self.int),
Expand Down

0 comments on commit 1506761

Please sign in to comment.