From 8ce5bae872ad85453317df7727f96a14503188b4 Mon Sep 17 00:00:00 2001 From: Eric Joldasov Date: Thu, 11 Jan 2024 17:22:48 +0600 Subject: [PATCH] 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 --- src/ui.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui.zig b/src/ui.zig index 93f01f4..3851ed8 100644 --- a/src/ui.zig +++ b/src/ui.zig @@ -194,7 +194,7 @@ test "shorten" { const StyleAttr = struct { fg: i16, bg: i16, attr: u32 }; const StyleDef = struct { - name: []const u8, + name: [:0]const u8, off: StyleAttr, dark: StyleAttr, darkbg: StyleAttr, @@ -279,7 +279,7 @@ const styles = [_]StyleDef{ }; 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| { field.* = .{ .name = s.name,