This commit is contained in:
Des-Nerger 2024-11-21 05:38:08 +00:00 committed by GitHub
commit 7405ee3c4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1564,6 +1564,23 @@ const unwrapped = value catch 1234;
unwrapped == 1234{#endsyntax#}</pre>
</td>
</tr>
<tr>
<td>Forwarding Error Unwrap</td>
<td><pre>{#syntax#}try a{#endsyntax#}</pre></td>
<td>
<ul>
<li>{#link|Error Unions|Errors#}</li>
</ul>
</td>
<td>
Equivalent to:
<pre>{#syntax#}a catch |err| return err{#endsyntax#}</pre>
</td>
<td>
<pre>{#syntax#}const value: anyerror!u32 = 5678;
(try value) == 5678{#endsyntax#}</pre>
</td>
</tr>
<tr>
<td>Logical And</td>
<td><pre>{#syntax#}a and b{#endsyntax#}</pre></td>
@ -1845,7 +1862,7 @@ const B = error{Two};
<pre>{#syntax#}x() x[] x.y x.* x.?
a!b
x{}
!x -x -%x ~x &x ?x
!x -x -%x ~x &x ?x try
* / % ** *% *| ||
+ - ++ +% -% +| -|
<< >> <<|
@ -1853,6 +1870,7 @@ x{}
== != < > <= >=
and
or
return break continue
= *= *%= *|= /= %= += +%= +|= -= -%= -|= <<= <<|= >>= &= ^= |={#endsyntax#}</pre>
{#header_close#}
{#header_close#}