aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-05-27 20:53:25 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-05-27 20:56:49 -0700
commit5bdfe22092716d0e590979a678a3f5bf715439e9 (patch)
tree770048e8a4d237e384e3e9b4209ebb3f9d32c9c7 /src
parent947a3a1be92e0d5ddc5ad263d9434b31e8c170db (diff)
downloadzig-5bdfe22092716d0e590979a678a3f5bf715439e9.tar.gz
zig-5bdfe22092716d0e590979a678a3f5bf715439e9.zip
CLI: actually fix translate-c creating root progress node twice
7281cc1d839da6e84bb76fadb2c1eafc22a82df7 did not solve the problem because even when Node.index is none, it still counts as initializing the global Progress object. Just use a normal zig optional, and all is good.
Diffstat (limited to 'src')
-rw-r--r--src/main.zig11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/main.zig b/src/main.zig
index cec15a087f..22349dd36a 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -5251,7 +5251,7 @@ const JitCmdOptions = struct {
capture: ?*[]u8 = null,
/// Send error bundles via std.zig.Server over stdout
server: bool = false,
- progress_node: std.Progress.Node = .{ .index = .none },
+ progress_node: ?std.Progress.Node = null,
};
fn jitCmd(
@@ -5261,12 +5261,9 @@ fn jitCmd(
options: JitCmdOptions,
) !void {
const color: Color = .auto;
- const root_prog_node = if (options.progress_node.index != .none)
- options.progress_node
- else
- std.Progress.start(.{
- .disable_printing = (color == .off),
- });
+ const root_prog_node = if (options.progress_node) |node| node else std.Progress.start(.{
+ .disable_printing = (color == .off),
+ });
const target_query: std.Target.Query = .{};
const resolved_target: Package.Module.ResolvedTarget = .{