feat: allow arrays of scalar values as config options
This commit is contained in:
parent
ada40b989c
commit
489c4027cb
1 changed files with 8 additions and 0 deletions
|
@ -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));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue