Skip to content

Commit 2225708

Browse files
committed
main: move stderr completely into io
1 parent 072545f commit 2225708

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main.zig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,8 @@ pub fn main() if (shared.is_debug_or_test) Command.ExposedError!u8 else u8 {
5151
var std_in_buffered = std.io.bufferedReader(std.io.getStdIn().reader());
5252
var std_out_buffered = std.io.bufferedWriter(std.io.getStdOut().writer());
5353

54-
const stderr_writer = std.io.getStdErr().writer();
5554
const io: IO = .{
56-
._stderr = stderr_writer.any(),
55+
._stderr = std.io.getStdErr().writer().any(),
5756
._stdin = std_in_buffered.reader().any(),
5857
._stdout = std_out_buffered.writer().any(),
5958
};
@@ -67,7 +66,7 @@ pub fn main() if (shared.is_debug_or_test) Command.ExposedError!u8 else u8 {
6766
exe_path,
6867
) catch |err| {
6968
switch (err) {
70-
error.OutOfMemory => stderr_writer.writeAll("out of memory\n") catch {},
69+
error.OutOfMemory => io._stderr.writeAll("out of memory\n") catch {},
7170
error.AlreadyHandled => return 1, // TODO: should this error be returned as well?
7271
}
7372

0 commit comments

Comments
 (0)