Skip to content

Commit 45081c1

Browse files
committed
hello world example can use const instead of var
1 parent 218a4d4 commit 45081c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

doc/langref.html.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ const std = @import("std");
165165

166166
pub fn main() !void {
167167
// 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();
169169
// If this program encounters pipe failure when printing to stdout, exit
170170
// with an error.
171171
try stdout_file.write("Hello, world!\n");

example/hello_world/hello.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const std = @import("std");
22

33
pub fn main() !void {
44
// 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();
66
// If this program encounters pipe failure when printing to stdout, exit
77
// with an error.
88
try stdout_file.write("Hello, world!\n");

0 commit comments

Comments
 (0)