From 660449c1c0be58ac39ca548fc63cc533755be01f Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Fri, 12 Dec 2025 14:11:28 +0100 Subject: [PATCH] refactor: use *std.Io.Writer instead of anytype --- src/text_manip.zig | 4 ++-- src/tui/mode/overlay/symbol_palette.zig | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/text_manip.zig b/src/text_manip.zig index 2197315..54307db 100644 --- a/src/text_manip.zig +++ b/src/text_manip.zig @@ -90,11 +90,11 @@ pub fn toggle_prefix_in_text(prefix: []const u8, text: []const u8, allocator: st return result.toOwnedSlice(allocator); } -pub fn write_string(writer: anytype, string: []const u8, pad: ?usize) !void { +pub fn write_string(writer: *std.Io.Writer, string: []const u8, pad: ?usize) !void { try writer.writeAll(string); if (pad) |pad_| try write_padding(writer, string.len, pad_); } -pub fn write_padding(writer: anytype, len: usize, pad_len: usize) !void { +pub fn write_padding(writer: *std.Io.Writer, len: usize, pad_len: usize) !void { for (0..pad_len - len) |_| try writer.writeAll(" "); } diff --git a/src/tui/mode/overlay/symbol_palette.zig b/src/tui/mode/overlay/symbol_palette.zig index 87d748c..67d15e6 100644 --- a/src/tui/mode/overlay/symbol_palette.zig +++ b/src/tui/mode/overlay/symbol_palette.zig @@ -74,7 +74,7 @@ fn update_max_col_sizes(palette: *Type, comp_sizes: []const usize) u8 { return total_length; } -fn write_columns(palette: *Type, writer: anytype, column_info: [][]const u8) void { +fn write_columns(palette: *Type, writer: *std.Io.Writer, column_info: [][]const u8) void { if (palette.value.column_size.len == 0) return; write_string(writer, column_info[0][0..@min(palette.value.column_size[0], column_info[0].len)], columns[0].max_width) catch {};