diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-07-10 12:04:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-10 12:04:27 +0200 |
| commit | 1a998886c863a1829d649f196093f1058cd9cf13 (patch) | |
| tree | db1b3b0a043a113cfb6544e8103cb64f8e4e4d8f /lib/std/bounded_array.zig | |
| parent | 5b4b033236a7bed19c90faf7fefbc1990911cfef (diff) | |
| parent | 10d6db5d7d1fb62ee2915a7ad2c7feb771ea3bbb (diff) | |
| download | zig-1a998886c863a1829d649f196093f1058cd9cf13.tar.gz zig-1a998886c863a1829d649f196093f1058cd9cf13.zip | |
Merge pull request #24329 from ziglang/writergate
Deprecates all existing std.io readers and writers in favor of the newly
provided std.io.Reader and std.io.Writer which are non-generic and have the
buffer above the vtable - in other words the buffer is in the interface, not
the implementation. This means that although Reader and Writer are no longer
generic, they are still transparent to optimization; all of the interface
functions have a concrete hot path operating on the buffer, and only make
vtable calls when the buffer is full.
Diffstat (limited to 'lib/std/bounded_array.zig')
| -rw-r--r-- | lib/std/bounded_array.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/bounded_array.zig b/lib/std/bounded_array.zig index 1a4407e687..7864dfb775 100644 --- a/lib/std/bounded_array.zig +++ b/lib/std/bounded_array.zig @@ -277,7 +277,7 @@ pub fn BoundedArrayAligned( @compileError("The Writer interface is only defined for BoundedArray(u8, ...) " ++ "but the given type is BoundedArray(" ++ @typeName(T) ++ ", ...)") else - std.io.Writer(*Self, error{Overflow}, appendWrite); + std.io.GenericWriter(*Self, error{Overflow}, appendWrite); /// Initializes a writer which will write into the array. pub fn writer(self: *Self) Writer { @@ -285,7 +285,7 @@ pub fn BoundedArrayAligned( } /// Same as `appendSlice` except it returns the number of bytes written, which is always the same - /// as `m.len`. The purpose of this function existing is to match `std.io.Writer` API. + /// as `m.len`. The purpose of this function existing is to match `std.io.GenericWriter` API. fn appendWrite(self: *Self, m: []const u8) error{Overflow}!usize { try self.appendSlice(m); return m.len; |
