From cbac7a019473055aaf6b1a87b4b57b9872ed54b4 Mon Sep 17 00:00:00 2001 From: Loris Cro Date: Thu, 4 Aug 2022 20:27:46 +0200 Subject: [PATCH] init-exe template: small improvements --- lib/init-exe/src/main.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/init-exe/src/main.zig b/lib/init-exe/src/main.zig index 433d311599..45d075af88 100644 --- a/lib/init-exe/src/main.zig +++ b/lib/init-exe/src/main.zig @@ -1,7 +1,7 @@ const std = @import("std"); pub fn main() !void { - // Prints to stderr + // Prints to stderr (it's a shortcut based on `std.io.getStdErr()`) std.debug.print("All your {s} are belong to us.\n", .{"codebase"}); // Prints to stdout @@ -18,5 +18,5 @@ test "simple test" { var list = std.ArrayList(i32).init(std.testing.allocator); defer list.deinit(); // try commenting this out and see if zig detects the memory leak! try list.append(42); - try std.testing.expectEqual(list.pop(), 42); + try std.testing.expectEqual(@as(i32, 42), list.pop()); }