zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit eeb4f376a31a0d6ca3f997becd2f247ebe71dfd6 (tree)
parent 49bc33efe194dd20ce12b7db3f78ed4359492ff2
Author: Andrew Kelley <superjoe30@gmail.com>
Date:   Tue, 16 Oct 2018 12:48:38 -0400

std.io: fix compile error when InStream has empty error set

Diffstat:
Mstd/io.zig | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/std/io.zig b/std/io.zig @@ -114,14 +114,14 @@ pub fn InStream(comptime ReadError: type) type { /// Returns the number of bytes read. It may be less than buffer.len. /// If the number of bytes read is 0, it means end of stream. /// End of stream is not an error condition. - pub fn read(self: *Self, buffer: []u8) !usize { + pub fn read(self: *Self, buffer: []u8) Error!usize { return self.readFn(self, buffer); } /// Returns the number of bytes read. If the number read is smaller than buf.len, it /// means the stream reached the end. Reaching the end of a stream is not an error /// condition. - pub fn readFull(self: *Self, buffer: []u8) !usize { + pub fn readFull(self: *Self, buffer: []u8) Error!usize { var index: usize = 0; while (index != buffer.len) { const amt = try self.read(buffer[index..]);