mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
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.
This commit is contained in:
parent
947a3a1be9
commit
5bdfe22092
1 changed files with 4 additions and 7 deletions
|
|
@ -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,10 +5261,7 @@ 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(.{
|
||||
const root_prog_node = if (options.progress_node) |node| node else std.Progress.start(.{
|
||||
.disable_printing = (color == .off),
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue