feat: allow arrays of scalar values as config options

This commit is contained in:
CJ van den Berg 2025-07-16 19:38:56 +02:00
parent ada40b989c
commit 489c4027cb
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -687,6 +687,14 @@ fn config_eql(comptime T: type, a: T, b: T) bool {
return false; return false;
return config_eql(info.child, a.?, b.?); return config_eql(info.child, a.?, b.?);
}, },
.pointer => |info| switch (info.size) {
.slice => {
if (a.len != b.len) return false;
for (a, 0..) |x, i| if (!config_eql(info.child, x, b[i])) return false;
return true;
},
else => @compileError("unsupported config type " ++ @typeName(T)),
},
else => {}, else => {},
} }
@compileError("unsupported config type " ++ @typeName(T)); @compileError("unsupported config type " ++ @typeName(T));