mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-07 22:34:28 +00:00
std.log: deduplicate switch
This commit is contained in:
parent
f1da93af3c
commit
13d58258a8
1 changed files with 1 additions and 6 deletions
|
|
@ -85,12 +85,7 @@ pub const Level = enum {
|
||||||
debug,
|
debug,
|
||||||
|
|
||||||
/// Returns a string literal of the given level in full text form.
|
/// Returns a string literal of the given level in full text form.
|
||||||
pub fn asText(comptime self: Level) switch (self) {
|
pub fn asText(comptime self: Level) []const u8 {
|
||||||
.err => @TypeOf("error"),
|
|
||||||
.warn => @TypeOf("warning"),
|
|
||||||
.info => @TypeOf("info"),
|
|
||||||
.debug => @TypeOf("debug"),
|
|
||||||
} {
|
|
||||||
return switch (self) {
|
return switch (self) {
|
||||||
.err => "error",
|
.err => "error",
|
||||||
.warn => "warning",
|
.warn => "warning",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue