Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos in std.io #589

Merged
merged 1 commit into from Nov 6, 2017
Merged

Fix typos in std.io #589

merged 1 commit into from Nov 6, 2017

Conversation

scurest
Copy link
Contributor

@scurest scurest commented Nov 6, 2017

The fix for readAllAlloc was tested with

$ cat hello.txt
hello
$ cat a.zig
const io = @import("std").io;
const mem = @import("std").mem;
const assert = @import("std").debug.assert;
const heap = @import("std").heap;
pub fn main() -> %void {
    var f = %return io.File.openRead("hello.txt", &heap.c_allocator);
    const in = &f.in_stream;
    const buf = %return in.readAllAlloc(&heap.c_allocator, 100);
    assert(mem.eql(u8, buf, "hello\n"));
}
$ zig build-exe --library c a.zig
$ ./a && echo $?
0

Fixes a bug that prevented InStream.realAllAlloc from compiling.
@andrewrk andrewrk merged commit f0dafd3 into ziglang:master Nov 6, 2017
@andrewrk
Copy link
Member

andrewrk commented Nov 6, 2017

Thanks again.

You've been consistently submitting helpful pull requests. Would you like to become a member of the zig-lang organization and have commit access?

@scurest
Copy link
Contributor Author

scurest commented Nov 6, 2017

I guess that's fine. Actually, I'm not really sure what that entails.

@scurest scurest deleted the std_io_typos branch November 12, 2017 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants