062_loop_expressions.patch 411 B

1234567891011
  1. --- exercises/062_loop_expressions.zig 2023-10-03 22:15:22.125574535 +0200
  2. +++ answers/062_loop_expressions.zig 2023-10-05 20:04:07.122768129 +0200
  3. @@ -47,7 +47,7 @@
  4. // return it from the for loop.
  5. const current_lang: ?[]const u8 = for (langs) |lang| {
  6. if (lang.len == 3) break lang;
  7. - };
  8. + } else null;
  9. if (current_lang) |cl| {
  10. print("Current language: {s}\n", .{cl});