src/ui.zig: update to language changes in Zig 0.12.0-dev.2150+63de8a598

* `name` field of std.builtin.Type struct changed type from `[]const u8` to `[:0]const u8`:
 https://github.com/ziglang/zig/pull/18470 .

 * New `'comptime var' is redundant in comptime scope` error
 introduced in https://github.com/ziglang/zig/pull/18242 .

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
This commit is contained in:
Eric Joldasov 2024-01-11 17:22:48 +06:00
parent c41e3f5828
commit 8ce5bae872
No known key found for this signature in database
GPG key ID: 5C9C69060686B588

View file

@ -194,7 +194,7 @@ test "shorten" {
const StyleAttr = struct { fg: i16, bg: i16, attr: u32 }; const StyleAttr = struct { fg: i16, bg: i16, attr: u32 };
const StyleDef = struct { const StyleDef = struct {
name: []const u8, name: [:0]const u8,
off: StyleAttr, off: StyleAttr,
dark: StyleAttr, dark: StyleAttr,
darkbg: StyleAttr, darkbg: StyleAttr,
@ -279,7 +279,7 @@ const styles = [_]StyleDef{
}; };
pub const Style = lbl: { pub const Style = lbl: {
comptime var fields: [styles.len]std.builtin.Type.EnumField = undefined; var fields: [styles.len]std.builtin.Type.EnumField = undefined;
for (&fields, styles, 0..) |*field, s, i| { for (&fields, styles, 0..) |*field, s, i| {
field.* = .{ field.* = .{
.name = s.name, .name = s.name,