docs: fix handle_error_with_catch_block typo
3 files changed, 12 insertions(+), 12 deletions(-)
doc
doc/langref.html.in+1-1
| ... | ... | @@ -3025,7 +3025,7 @@ or |
| 3025 | 3025 | {#syntax#}catch{#endsyntax#} after performing some logic, you |
| 3026 | 3026 | can combine {#syntax#}catch{#endsyntax#} with named {#link|Blocks#}: |
| 3027 | 3027 | </p> |
| 3028 | | {#code|handle_error_with_catch_block.zig.zig#} |
| 3028 | {#code|handle_error_with_catch_block.zig#} |
| 3029 | 3029 | |
| 3030 | 3030 | {#header_close#} |
| 3031 | 3031 | {#header_open|try#} |
doc/langref/handle_error_with_catch_block.zig created+11
| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | const parseU64 = @import("error_union_parsing_u64.zig").parseU64; |
| 2 | |
| 3 | fn doAThing(str: []u8) void { |
| 4 | const number = parseU64(str, 10) catch blk: { |
| 5 | // do things |
| 6 | break :blk 13; |
| 7 | }; |
| 8 | _ = number; // number is now initialized |
| 9 | } |
| 10 | |
| 11 | // syntax |
doc/langref/handle_error_with_catch_block.zig.zig deleted-11
| ... | ... | @@ -1,11 +0,0 @@ |
| 1 | | const parseU64 = @import("error_union_parsing_u64.zig").parseU64; |
| 2 | | |
| 3 | | fn doAThing(str: []u8) void { |
| 4 | | const number = parseU64(str, 10) catch blk: { |
| 5 | | // do things |
| 6 | | break :blk 13; |
| 7 | | }; |
| 8 | | _ = number; // number is now initialized |
| 9 | | } |
| 10 | | |
| 11 | | // syntax |