diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-01-07 16:51:46 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-01-07 16:53:13 -0500 |
| commit | 66717db735b9ddac9298bf08fcf95e7e11629fee (patch) | |
| tree | 54dea549c62d851da9269b09eba8e596450ee330 /std/os/get_user_id.zig | |
| parent | de1f57926f212f18a98884fa8b1d0df7f7bc7f03 (diff) | |
| download | zig-66717db735b9ddac9298bf08fcf95e7e11629fee.tar.gz zig-66717db735b9ddac9298bf08fcf95e7e11629fee.zip | |
replace `%return` with `try`
See #632
better fits the convention of using keywords for control flow
Diffstat (limited to 'std/os/get_user_id.zig')
| -rw-r--r-- | std/os/get_user_id.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/std/os/get_user_id.zig b/std/os/get_user_id.zig index 4b979a9a9d..7485f788fc 100644 --- a/std/os/get_user_id.zig +++ b/std/os/get_user_id.zig @@ -31,7 +31,7 @@ error CorruptPasswordFile; // like NIS, AD, etc. See `man nss` or look at an strace for `id myuser`. pub fn posixGetUserInfo(name: []const u8) -> %UserInfo { - var in_stream = %return io.InStream.open("/etc/passwd", null); + var in_stream = try io.InStream.open("/etc/passwd", null); defer in_stream.close(); var buf: [os.page_size]u8 = undefined; @@ -41,7 +41,7 @@ pub fn posixGetUserInfo(name: []const u8) -> %UserInfo { var gid: u32 = 0; while (true) { - const amt_read = %return in_stream.read(buf[0..]); + const amt_read = try in_stream.read(buf[0..]); for (buf[0..amt_read]) |byte| { switch (state) { State.Start => switch (byte) { |
