authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-30 20:54:06-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-31 22:52:00-08:00
log9bd648bd4099d4ba14785bea4d7e0aa9e81fb105
tree4796191d3dba683135077fa33019efdef5b58acf
parent3abc96a601d2349cc1743774f0cebb2eb0ea0c61

std.Io.Operation: support non-fallible results


1 files changed, 2 insertions(+), 2 deletions(-)

lib/std/Io.zig+2-2
......@@ -287,7 +287,7 @@ pub const Operation = union(enum) {
287287 LockViolation,
288288 } || Io.UnexpectedError;
289289
290 pub const Result = usize;
290 pub const Result = Error!usize;
291291 };
292292
293293 pub const Result = Result: {
......@@ -296,7 +296,7 @@ pub const Operation = union(enum) {
296296 var field_types: [operation_fields.len]type = undefined;
297297 for (operation_fields, &field_names, &field_types) |field, *field_name, *field_type| {
298298 field_name.* = field.name;
299 field_type.* = field.type.Error!field.type.Result;
299 field_type.* = field.type.Result;
300300 }
301301 break :Result @Union(.auto, Tag, &field_names, &field_types, &@splat(.{}));
302302 };