diff --git a/lib/std/Io.zig b/lib/std/Io.zig index 980379b72b985fdd5107e522eda9bdbee475caf0..a63a89e4ee020f91a959e62ee91782d120348c6b 100644 --- a/lib/std/Io.zig +++ b/lib/std/Io.zig @@ -303,7 +303,7 @@ pub const Operation = union(enum) { /// Performs one `Operation`. pub fn operate(io: Io, operation: *Operation) Cancelable!void { - return io.vtable.operate(io.userdata, operation) catch unreachable; + return io.vtable.operate(io.userdata, operation); } /// Submits many operations together without waiting for all of them to diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig index 2167baa5e48ced7aa41f4f9b6581b0e6e62c1c04..55a4c8aad73c59bb4c19bb4435877d33db033dac 100644 --- a/lib/std/Io/Threaded.zig +++ b/lib/std/Io/Threaded.zig @@ -2465,7 +2465,7 @@ fn operate(userdata: ?*anyopaque, op: *Io.Operation) Io.Cancelable!void { .file_read_streaming => |*o| { _ = o.status.unstarted; o.status = .{ .result = fileReadStreaming(o.file, o.data) catch |err| switch (err) { - error.Canceled => return error.Canceled, + error.Canceled => |e| return e, else => |e| e, } }; },