This commit is contained in:
Adam Millerchip 2021-12-31 02:03:32 +09:00
parent 881b4d1051
commit 876f4a7ef4
1 changed files with 3 additions and 3 deletions

View File

@ -44,14 +44,14 @@ pub fn main() void {
std.debug.print("Insect report! ", .{});
// Could it really be as simple as just passing the union?
printInsect(???);
printInsect(???);
printInsect(ant);
printInsect(bee);
std.debug.print("\n", .{});
}
fn printInsect(insect: Insect) void {
switch (???) {
switch (insect) {
.still_alive => |a| std.debug.print("Ant alive is: {}. ", .{a}),
.flowers_visited => |f| std.debug.print("Bee visited {} flowers. ", .{f}),
}