From eeb4f376a31a0d6ca3f997becd2f247ebe71dfd6 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 16 Oct 2018 12:48:38 -0400 Subject: [PATCH] std.io: fix compile error when InStream has empty error set --- std/io.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/std/io.zig b/std/io.zig index a940565ae..c35eda821 100644 --- 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..]);