fixed compileError printing

This commit is contained in:
Chris Boesch
2026-04-30 19:30:27 +02:00
parent 4bdcf195b9
commit 3a782a96d5
2 changed files with 9 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
const print = @import("std").debug.print;
const std = @import("std");
const print = std.debug.print;
// We're going to (ab)use the power of Zig to make animal hybrid creatures!
// What do you think a GatorMouse would look like? Eek.
@@ -58,7 +59,7 @@ fn makeCreature(comptime count: usize, comptime fmt: []const u8) [count]Animal {
// other animals or is this an error?
'g' => ???,
else => @compileError("No animal starts with '" ++ char ++ "'!"),
else => @compileError(std.fmt.comptimePrint("No animal starts with '{c}'!", .{char})),
},
.l => switch (char) {