Open nemelu opened 4 months ago
This example is a little bit confusing because the while condition is redundant:
test "while optional" { var i: ?u32 = 10; while (i) |num| : (i.? -= 1) { try expect(@TypeOf(num) == u32); if (num == 1) { i = null; break; } } try expect(i == null); }
I think it would be better like this:
test "while optional" { var i: ?u32 = 10; while (i) |num| { try expect(@TypeOf(num) == u32); i.? -= 1; if (num == 1) { i = null; } } try expect(i == null); }
This example is a little bit confusing because the while condition is redundant:
I think it would be better like this: