From d579375a7af91320bd932878d2a5b124e2572b11 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 14 Jan 2026 00:23:33 -0800 Subject: [PATCH] std.Io.operate: fix bogus catch this used to have a different error set. just goes to show you how useful switching on error set is even when there is only 1 prong --- lib/std/Io.zig | 2 +- lib/std/Io/Threaded.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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, } }; }, -- 2.54.0