Commit cbac7a0194

Loris Cro <kappaloris@gmail.com>
2022-08-04 20:27:46
init-exe template: small improvements
1 parent fb0b9f0
Changed files (1)
lib
init-exe
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());
 }