From 91a08af5702cba683ae2d418ff57307f159e3281 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 24 Jun 2026 13:56:13 -0700 Subject: [PATCH] std.Progress: move Options closer to where it is used no functional change --- lib/std/Progress.zig | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/std/Progress.zig b/lib/std/Progress.zig index 70c61f27e2b15d6d7f903e6d778f4bd0963b5d3c..b0f1b5f9a9011427e48c83c334c602c69c6f42c2 100644 --- a/lib/std/Progress.zig +++ b/lib/std/Progress.zig @@ -165,25 +165,6 @@ pub const TerminalMode = union(enum) { }; }; -pub const Options = struct { - /// User-provided buffer with static lifetime. - /// - /// Used to store the entire write buffer sent to the terminal. Progress output will be truncated if it - /// cannot fit into this buffer which will look bad but not cause any malfunctions. - /// - /// Must be at least 200 bytes. - draw_buffer: []u8 = &default_draw_buffer, - /// How many nanoseconds between writing updates to the terminal. - refresh_rate_ns: Io.Duration = .fromMilliseconds(80), - /// How many nanoseconds to keep the output hidden - initial_delay_ns: Io.Duration = .fromMilliseconds(200), - /// If provided, causes the progress item to have a denominator. - /// 0 means unknown. - estimated_total_items: usize = 0, - root_name: []const u8 = "", - disable_printing: bool = false, -}; - /// Represents one unit of progress. Each node can have children nodes, or /// one can use integers with `update`. pub const Node = struct { @@ -578,6 +559,25 @@ pub const ParentFileError = error{ UnrecognizedFormat, }; +pub const Options = struct { + /// User-provided buffer with static lifetime. + /// + /// Used to store the entire write buffer sent to the terminal. Progress output will be truncated if it + /// cannot fit into this buffer which will look bad but not cause any malfunctions. + /// + /// Must be at least 200 bytes. + draw_buffer: []u8 = &default_draw_buffer, + /// How many nanoseconds between writing updates to the terminal. + refresh_rate_ns: Io.Duration = .fromMilliseconds(80), + /// How many nanoseconds to keep the output hidden + initial_delay_ns: Io.Duration = .fromMilliseconds(200), + /// If provided, causes the progress item to have a denominator. + /// 0 means unknown. + estimated_total_items: usize = 0, + root_name: []const u8 = "", + disable_printing: bool = false, +}; + /// Initializes a global Progress instance. /// /// Asserts there is only one global Progress instance. -- 2.54.0