added eof error since read does not raise errors for it

This commit is contained in:
Muaz Ahmad 2023-12-12 14:55:31 +05:00
parent f97456aab8
commit 5ef9f52d95
2 changed files with 12 additions and 1 deletions

View file

@ -65,5 +65,12 @@ pub fn main() !void {
defer thread_manager.deinit(); defer thread_manager.deinit();
var f = std.io.getStdIn(); var f = std.io.getStdIn();
try input.main_loop(f, buffs, &thread_manager, std.heap.page_allocator); input.main_loop(f, buffs, &thread_manager, std.heap.page_allocator) catch |err| {
switch (err) {
util.Errors.EOFError => {
return;
},
else => return err,
}
};
} }

View file

@ -1,5 +1,9 @@
const std = @import("std"); const std = @import("std");
pub const Errors = error{
EOFError,
};
pub const Options = struct { pub const Options = struct {
width: usize, width: usize,
height: usize, height: usize,