aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorr00ster91 <r00ster91@proton.me>2022-07-06 19:27:47 +0200
committerVeikka Tuominen <git@vexu.eu>2022-07-09 15:19:03 +0300
commit13d58258a8d24136016e01e02ea84966d5fc66c3 (patch)
tree7337f865d07eb141cab8a13f73275d1db112fbb9 /lib
parentf1da93af3cc9a70871d28a00dcdbbb4254e42e3a (diff)
downloadzig-13d58258a8d24136016e01e02ea84966d5fc66c3.tar.gz
zig-13d58258a8d24136016e01e02ea84966d5fc66c3.zip
`std.log`: deduplicate `switch`
Diffstat (limited to 'lib')
-rw-r--r--lib/std/log.zig7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/std/log.zig b/lib/std/log.zig
index 4110fe6d8d..081344f2c8 100644
--- 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",