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 /example/hello_world/hello.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 'example/hello_world/hello.zig')
| -rw-r--r-- | example/hello_world/hello.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/example/hello_world/hello.zig b/example/hello_world/hello.zig index 6dc27edc96..e9e568187e 100644 --- a/example/hello_world/hello.zig +++ b/example/hello_world/hello.zig @@ -2,8 +2,8 @@ const std = @import("std"); pub fn main() -> %void { // If this program is run without stdout attached, exit with an error. - var stdout_file = %return std.io.getStdOut(); + var stdout_file = try std.io.getStdOut(); // If this program encounters pipe failure when printing to stdout, exit // with an error. - %return stdout_file.write("Hello, world!\n"); + try stdout_file.write("Hello, world!\n"); } |
