From 5031124a8025387455feabd130b09f20f400b9ea Mon Sep 17 00:00:00 2001 From: Alexei Samokvalov Date: Sat, 18 Jan 2025 11:33:09 +0100 Subject: [PATCH] Update to the latest zig version --- src/struct_mapping.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/struct_mapping.zig b/src/struct_mapping.zig index ff8881c..0296394 100644 --- a/src/struct_mapping.zig +++ b/src/struct_mapping.zig @@ -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; } @@ -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) {