diff options
| author | InKryption <59504965+InKryption@users.noreply.github.com> | 2022-07-24 11:01:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-24 12:01:56 +0300 |
| commit | 7cbd586ace46a8e8cebab660ebca3cfc049305d9 (patch) | |
| tree | 10514a09063847aaed2a8dcc9b0f2196f0cc3ef4 /doc | |
| parent | 0b4a3ec9501b31e7b31e81b83e5974e6c6d72757 (diff) | |
| download | zig-7cbd586ace46a8e8cebab660ebca3cfc049305d9.tar.gz zig-7cbd586ace46a8e8cebab660ebca3cfc049305d9.zip | |
std.fmt: require specifier for unwrapping ?T and E!T.
Co-authored-by: Veikka Tuominen <git@vexu.eu>
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/langref.html.in | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in index 13c7da4a8a..81ccd58261 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -574,7 +574,7 @@ pub fn main() void { var optional_value: ?[]const u8 = null; assert(optional_value == null); - print("\noptional 1\ntype: {s}\nvalue: {s}\n", .{ + print("\noptional 1\ntype: {s}\nvalue: {?s}\n", .{ @typeName(@TypeOf(optional_value)), optional_value, }); @@ -582,7 +582,7 @@ pub fn main() void { optional_value = "hi"; assert(optional_value != null); - print("\noptional 2\ntype: {s}\nvalue: {s}\n", .{ + print("\noptional 2\ntype: {s}\nvalue: {?s}\n", .{ @typeName(@TypeOf(optional_value)), optional_value, }); @@ -590,14 +590,14 @@ pub fn main() void { // error union var number_or_error: anyerror!i32 = error.ArgNotFound; - print("\nerror union 1\ntype: {s}\nvalue: {}\n", .{ + print("\nerror union 1\ntype: {s}\nvalue: {!}\n", .{ @typeName(@TypeOf(number_or_error)), number_or_error, }); number_or_error = 1234; - print("\nerror union 2\ntype: {s}\nvalue: {}\n", .{ + print("\nerror union 2\ntype: {s}\nvalue: {!}\n", .{ @typeName(@TypeOf(number_or_error)), number_or_error, }); |
