zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 13d58258a8d24136016e01e02ea84966d5fc66c3 (tree)
parent f1da93af3cc9a70871d28a00dcdbbb4254e42e3a
Author: r00ster91 <r00ster91@proton.me>
Date:   Wed,  6 Jul 2022 19:27:47 +0200

`std.log`: deduplicate `switch`
Diffstat:
Mlib/std/log.zig | 7+------
1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/lib/std/log.zig b/lib/std/log.zig @@ -85,12 +85,7 @@ pub const Level = enum { debug, /// Returns a string literal of the given level in full text form. - pub fn asText(comptime self: Level) switch (self) { - .err => @TypeOf("error"), - .warn => @TypeOf("warning"), - .info => @TypeOf("info"), - .debug => @TypeOf("debug"), - } { + pub fn asText(comptime self: Level) []const u8 { return switch (self) { .err => "error", .warn => "warning",