Merge branch 'master' into zig-0.14
This commit is contained in:
commit
c41cd07085
7 changed files with 54 additions and 36 deletions
|
@ -623,6 +623,13 @@ fn config_eql(comptime T: type, a: T, b: T) bool {
|
|||
}
|
||||
switch (@typeInfo(T)) {
|
||||
.bool, .int, .float, .@"enum" => return a == b,
|
||||
.optional => |info| {
|
||||
if (a == null and b == null)
|
||||
return true;
|
||||
if (a == null or b == null)
|
||||
return false;
|
||||
return config_eql(info.child, a.?, b.?);
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
@compileError("unsupported config type " ++ @typeName(T));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue