authorgravatar for rory@roryokane.comRory O’Kane <rory@roryokane.com> 2021-09-12 13:08:56-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-09-20 02:04:31-04:00
logb3ae69d80b5bc04a334882d955d638eac64eef33
treec613fe0a1d1bae1b84a6d5cd35ecc012df82355f
parentdb181b173f6debc2dbb1e68342ff46a4299c19a9

langref: define the inferred error set syntax more explicitly

This edit allows the reader to understand the syntax this section is talking about more quickly – they don’t have to read the whole code block and understand which part of it demonstrates the feature being described. Affects https://ziglang.org/documentation/master/#Inferred-Error-Sets

1 files changed, 1 insertions(+), 1 deletions(-)

doc/langref.html.in+1-1
...@@ -4955,7 +4955,7 @@ test "merge error sets" {...@@ -4955,7 +4955,7 @@ test "merge error sets" {
4955 {#header_open|Inferred Error Sets#}4955 {#header_open|Inferred Error Sets#}
4956 <p>4956 <p>
4957 Because many functions in Zig return a possible error, Zig supports inferring the error set.4957 Because many functions in Zig return a possible error, Zig supports inferring the error set.
4958 To infer the error set for a function, use this syntax:4958 To infer the error set for a function, prepend the {#syntax#}!{#endsyntax#} operator to the function’s return type, like {#syntax#}!T{#endsyntax#}:
4959 </p>4959 </p>
4960{#code_begin|test|inferred_error_sets#}4960{#code_begin|test|inferred_error_sets#}
4961// With an inferred error set4961// With an inferred error set