mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
std.Io.Operation: support non-fallible results
This commit is contained in:
+2
-2
@@ -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(.{}));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user