mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
Add cross references for optional documentation and another example of optional capture in while loop.
This commit is contained in:
parent
56deb5b054
commit
cce820f93d
1 changed files with 10 additions and 0 deletions
|
|
@ -4635,6 +4635,14 @@ test "while null capture" {
|
|||
} else {
|
||||
try expect(sum2 == 3);
|
||||
}
|
||||
|
||||
var i: u32 = 0;
|
||||
var sum3: u32 = 0;
|
||||
numbers_left = 3;
|
||||
while (eventuallyNullSequence()) |value| : (i += 1) {
|
||||
sum3 += value;
|
||||
}
|
||||
try expect(i == 3);
|
||||
}
|
||||
|
||||
var numbers_left: u32 = undefined;
|
||||
|
|
@ -6329,6 +6337,8 @@ test "optional pointers" {
|
|||
}
|
||||
{#code_end#}
|
||||
{#header_close#}
|
||||
|
||||
{#see_also|while with Optionals|if#}
|
||||
{#header_close#}
|
||||
{#header_open|Casting#}
|
||||
<p>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue