Skip to content

Commit 13d5825

Browse files
r00ster91Vexu
authored andcommitted
std.log: deduplicate switch
1 parent f1da93a commit 13d5825

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/std/log.zig

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,7 @@ pub const Level = enum {
8585
debug,
8686

8787
/// Returns a string literal of the given level in full text form.
88-
pub fn asText(comptime self: Level) switch (self) {
89-
.err => @TypeOf("error"),
90-
.warn => @TypeOf("warning"),
91-
.info => @TypeOf("info"),
92-
.debug => @TypeOf("debug"),
93-
} {
88+
pub fn asText(comptime self: Level) []const u8 {
9489
return switch (self) {
9590
.err => "error",
9691
.warn => "warning",

0 commit comments

Comments
 (0)