Skip to content

Commit

Permalink
Update to the latest zig version
Browse files Browse the repository at this point in the history
  • Loading branch information
sam701 committed Jan 18, 2025
1 parent 561a076 commit 5031124
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/struct_mapping.zig
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn intoStruct(ctx: *Context, comptime T: type, dest: *T, table: *Table) !voi
} else {
if (@typeInfo(field_info.type) == .optional)
@field(dest.*, field_info.name) = null
else if (field_info.default_value) |defaultValue| {
else if (field_info.default_value_ptr) |defaultValue| {
@field(dest.*, field_info.name) = @as(*const field_info.type, @alignCast(@ptrCast(defaultValue))).*;
} else return error.MissingRequiredField;
}
Expand Down Expand Up @@ -119,12 +119,12 @@ fn setValue(ctx: *Context, comptime T: type, dest: *T, value: *const Value) !voi
},
.pointer => |tinfo| {
switch (tinfo.size) {
.One => {
.one => {
dest.* = try ctx.alloc.create(tinfo.child);
errdefer ctx.alloc.destroy(dest.*);
return setValue(ctx, tinfo.child, dest.*, value);
},
.Slice => {},
.slice => {},
else => return error.NotSupportedFieldType,
}
switch (tinfo.child) {
Expand Down

0 comments on commit 5031124

Please sign in to comment.