045_optionals.patch 419 B

1234567891011
  1. --- exercises/045_optionals.zig 2023-10-03 22:15:22.122241138 +0200
  2. +++ answers/045_optionals.zig 2023-10-05 20:04:07.046100027 +0200
  3. @@ -29,7 +29,7 @@
  4. // Please threaten the result so that answer is either the
  5. // integer value from deepThought() OR the number 42:
  6. - const answer: u8 = result;
  7. + const answer: u8 = result orelse 42;
  8. std.debug.print("The Ultimate Answer: {}.\n", .{answer});
  9. }