mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
std: fix StreamSource to disallow writing to a const buffer
This commit is contained in:
parent
b702964ae2
commit
d29ed2a785
@ -39,7 +39,7 @@ pub const StreamSource = union(enum) {
|
||||
pub fn write(self: *StreamSource, bytes: []const u8) WriteError!usize {
|
||||
switch (self.*) {
|
||||
.buffer => |*x| return x.write(bytes),
|
||||
.const_buffer => |*x| return x.write(bytes),
|
||||
.const_buffer => return error.AccessDenied,
|
||||
.file => |x| return x.write(bytes),
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user