doc: remove unnecessary anyerror keyword
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 2m28s
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 2m28s
Error union return type for format function documentation (and sample implementation) has been adjusted. This results in the exact same code, but without unnecessary error type definition, which is derived from the compiler anyway.
This commit is contained in:
@@ -19,7 +19,7 @@ const Options = enum {
|
||||
c,
|
||||
|
||||
// copy and paste this function into your user defined types to enable pretty printing for these types
|
||||
pub fn format(value: @This(), comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) anyerror!void {
|
||||
pub fn format(value: @This(), comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
try zlog.pretty_format(value, fmt, options, writer);
|
||||
}
|
||||
};
|
||||
@@ -32,7 +32,7 @@ const Struct = struct {
|
||||
e: Options = Options.b,
|
||||
|
||||
// same function as above...
|
||||
pub fn format(value: @This(), comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) anyerror!void {
|
||||
pub fn format(value: @This(), comptime fmt: []const u8, options: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
try zlog.pretty_format(value, fmt, options, writer);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user