Skip to content

Commit cce820f

Browse files
committed
Add cross references for optional documentation and another example of optional capture in while loop.
1 parent 56deb5b commit cce820f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/langref.html.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4635,6 +4635,14 @@ test "while null capture" {
46354635
} else {
46364636
try expect(sum2 == 3);
46374637
}
4638+
4639+
var i: u32 = 0;
4640+
var sum3: u32 = 0;
4641+
numbers_left = 3;
4642+
while (eventuallyNullSequence()) |value| : (i += 1) {
4643+
sum3 += value;
4644+
}
4645+
try expect(i == 3);
46384646
}
46394647

46404648
var numbers_left: u32 = undefined;
@@ -6329,6 +6337,8 @@ test "optional pointers" {
63296337
}
63306338
{#code_end#}
63316339
{#header_close#}
6340+
6341+
{#see_also|while with Optionals|if#}
63326342
{#header_close#}
63336343
{#header_open|Casting#}
63346344
<p>

0 commit comments

Comments
 (0)