028_defer2.patch 384 B

1234567891011
  1. --- exercises/028_defer2.zig 2023-10-03 22:15:22.122241138 +0200
  2. +++ answers/028_defer2.zig 2023-10-05 20:04:06.966098530 +0200
  3. @@ -18,7 +18,7 @@
  4. fn printAnimal(animal: u8) void {
  5. std.debug.print("(", .{});
  6. - std.debug.print(") ", .{}); // <---- how?!
  7. + defer std.debug.print(") ", .{}); // <---- how?!
  8. if (animal == 'g') {
  9. std.debug.print("Goat", .{});