diff options
| author | r00ster91 <r00ster91@proton.me> | 2022-07-30 14:46:55 +0200 |
|---|---|---|
| committer | r00ster91 <r00ster91@proton.me> | 2022-12-13 09:11:30 +0100 |
| commit | d0d845a25b897a8db37b0f60d5ec313f6b56943f (patch) | |
| tree | 620e8e828fe3eedb5b68e1f31ea23179c7b66034 /lib/std/debug.zig | |
| parent | d8b4588d5fe685637ebbbb57c139aca7fb12ddf5 (diff) | |
| download | zig-d0d845a25b897a8db37b0f60d5ec313f6b56943f.tar.gz zig-d0d845a25b897a8db37b0f60d5ec313f6b56943f.zip | |
cleanup: inline color constants
Originally I just wanted to move these down because they seemed to be in some random position of the file,
but these constants look very old with their CASING and pretty unnecessary anyway so I just inlined them.
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 718812961d..da78d4ee95 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -384,14 +384,6 @@ pub fn panicImpl(trace: ?*const std.builtin.StackTrace, first_trace_addr: ?usize os.abort(); } -const RED = "\x1b[31;1m"; -const GREEN = "\x1b[32;1m"; -const CYAN = "\x1b[36;1m"; -const WHITE = "\x1b[37;1m"; -const BOLD = "\x1b[1m"; -const DIM = "\x1b[2m"; -const RESET = "\x1b[0m"; - pub fn writeStackTrace( stack_trace: std.builtin.StackTrace, out_stream: anytype, @@ -615,13 +607,13 @@ pub const TTY = struct { .no_color => return, .escape_codes => { const color_string = switch (color) { - .Red => RED, - .Green => GREEN, - .Cyan => CYAN, - .White => WHITE, - .Dim => DIM, - .Bold => BOLD, - .Reset => RESET, + .Red => "\x1b[31;1m", + .Green => "\x1b[32;1m", + .Cyan => "\x1b[36;1m", + .White => "\x1b[37;1m", + .Bold => "\x1b[1m", + .Dim => "\x1b[2m", + .Reset => "\x1b[0m", }; try out_stream.writeAll(color_string); }, |
