mirror of
https://github.com/ziglang/zig.git
synced 2025-12-24 07:03:11 +00:00
Simplify File constructors
This commit is contained in:
parent
8bce1b6981
commit
b8112b3d17
@ -604,11 +604,7 @@ pub const Dir = struct {
|
||||
|
||||
const fd = try os.openatWasi(self.fd, sub_path, 0x0, fdflags, rights);
|
||||
|
||||
return File{
|
||||
.handle = fd,
|
||||
.io_mode = .blocking,
|
||||
.async_block_allowed = File.async_block_allowed_no,
|
||||
};
|
||||
return File{ .handle = fd };
|
||||
}
|
||||
|
||||
pub const openFileC = @compileError("deprecated: renamed to openFileZ");
|
||||
@ -719,11 +715,7 @@ pub const Dir = struct {
|
||||
|
||||
const fd = try os.openatWasi(self.fd, sub_path, oflags, 0x0, rights);
|
||||
|
||||
return File{
|
||||
.handle = fd,
|
||||
.io_mode = .blocking,
|
||||
.async_block_allowed = File.async_block_allowed_no,
|
||||
};
|
||||
return File{ .handle = fd };
|
||||
}
|
||||
|
||||
/// Same as `createFile` but the path parameter is null-terminated.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user