zig

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

commit f0dafd3f209a342f055850108651545bea9b065b (tree)
parent 52a29928628f042da6cb39b3c1f77af0bcb7dcd7
Author: scurest <scurest@users.noreply.github.com>
Date:   Mon,  6 Nov 2017 10:40:58 -0600

fix typos in std.io (#589)

Fixes a bug that prevented InStream.realAllAlloc from compiling.
Diffstat:
Mstd/io.zig | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/std/io.zig b/std/io.zig @@ -308,7 +308,7 @@ pub const InStream = struct { readFn: fn(self: &InStream, buffer: []u8) -> %usize, /// Replaces `buffer` contents by reading from the stream until it is finished. - /// If `buffer.len()` woould exceed `max_size`, `error.StreamTooLong` is returned and + /// If `buffer.len()` would exceed `max_size`, `error.StreamTooLong` is returned and /// the contents read from the stream are lost. pub fn readAllBuffer(self: &InStream, buffer: &Buffer, max_size: usize) -> %void { %return buffer.resize(0); @@ -339,7 +339,7 @@ pub const InStream = struct { var buf = Buffer.initNull(allocator); defer buf.deinit(); - %return self.readAllBuffer(self, &buf, max_size); + %return self.readAllBuffer(&buf, max_size); return buf.toOwnedSlice(); }