authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-12-23 13:56:49-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-12-23 13:57:37-05:00
log45081c1e9cc28757cb563c77553631f7a92b29d8
tree9ccb5708c94570fc8edc2e6fd925d60fd0916f96
parent218a4d4b30f320797121ad9900d48743da77a1b3
signaturelock-open Commit is signed but in an unrecognized format.

hello world example can use `const` instead of `var`


2 files changed, 2 insertions(+), 2 deletions(-)

doc/langref.html.in+1-1
...@@ -165,7 +165,7 @@ const std = @import("std");...@@ -165,7 +165,7 @@ const std = @import("std");
165165
166pub fn main() !void {166pub fn main() !void {
167 // If this program is run without stdout attached, exit with an error.167 // If this program is run without stdout attached, exit with an error.
168 var stdout_file = try std.io.getStdOut();168 const stdout_file = try std.io.getStdOut();
169 // If this program encounters pipe failure when printing to stdout, exit169 // If this program encounters pipe failure when printing to stdout, exit
170 // with an error.170 // with an error.
171 try stdout_file.write("Hello, world!\n");171 try stdout_file.write("Hello, world!\n");
example/hello_world/hello.zig+1-1
...@@ -2,7 +2,7 @@ const std = @import("std");...@@ -2,7 +2,7 @@ const std = @import("std");
22
3pub fn main() !void {3pub fn main() !void {
4 // If this program is run without stdout attached, exit with an error.4 // If this program is run without stdout attached, exit with an error.
5 var stdout_file = try std.io.getStdOut();5 const stdout_file = try std.io.getStdOut();
6 // If this program encounters pipe failure when printing to stdout, exit6 // If this program encounters pipe failure when printing to stdout, exit
7 // with an error.7 // with an error.
8 try stdout_file.write("Hello, world!\n");8 try stdout_file.write("Hello, world!\n");