From 2a637d688aee72c6724ed5ee5fb07442c1b73ee3 Mon Sep 17 00:00:00 2001 From: Uko Kokņevičs Date: Tue, 26 Apr 2022 00:36:59 +0300 Subject: Add a missing const --- src/list.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/list.zig b/src/list.zig index d97ba87..e5daa87 100644 --- a/src/list.zig +++ b/src/list.zig @@ -33,7 +33,8 @@ pub fn main(comptime Result: type, allocator: Allocator, res: Result) !void { if (list_active) { var active = try Installation.getActiveName(allocator); defer if (active) |s| allocator.free(s); - try printActive(active); + // TODO: zig-bug should I really need to do this? + try printActive(if (active) |a| a else null); } if (list_installed) { @@ -49,8 +50,7 @@ pub fn main(comptime Result: type, allocator: Allocator, res: Result) !void { } } -// TODO: zig-bug active should be ?[]const u8 -fn printActive(active: ?[]u8) !void { +fn printActive(active: ?[]const u8) !void { const writer = std.io.getStdOut().writer(); try writer.writeAll("Active installation: "); if (active) |act| { -- cgit v1.2.3