fix: build of writeArray with zig-0.14

This commit is contained in:
CJ van den Berg 2025-03-22 21:45:58 +01:00
parent 32505ed465
commit 183248d7f2
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -126,8 +126,8 @@ pub fn writeMapHeader(writer: anytype, sz: usize) @TypeOf(writer).Error!void {
pub fn writeArray(writer: anytype, args: anytype) @TypeOf(writer).Error!void {
const args_type_info = @typeInfo(@TypeOf(args));
if (args_type_info != .Struct) @compileError("expected tuple or struct argument");
const fields_info = args_type_info.Struct.fields;
if (args_type_info != .@"struct") @compileError("expected tuple or struct argument");
const fields_info = args_type_info.@"struct".fields;
try writeArrayHeader(writer, fields_info.len);
inline for (fields_info) |field_info|
try writeValue(writer, @field(args, field_info.name));