std.Io.Operation: support non-fallible results

This commit is contained in:
Andrew Kelley
2026-01-30 20:54:06 -08:00
parent 3abc96a601
commit 9bd648bd40
+2 -2
View File
@@ -287,7 +287,7 @@ pub const Operation = union(enum) {
LockViolation,
} || Io.UnexpectedError;
pub const Result = usize;
pub const Result = Error!usize;
};
pub const Result = Result: {
@@ -296,7 +296,7 @@ pub const Operation = union(enum) {
var field_types: [operation_fields.len]type = undefined;
for (operation_fields, &field_names, &field_types) |field, *field_name, *field_type| {
field_name.* = field.name;
field_type.* = field.type.Error!field.type.Result;
field_type.* = field.type.Result;
}
break :Result @Union(.auto, Tag, &field_names, &field_types, &@splat(.{}));
};