authorgravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2022-07-30 14:46:55+02:00
committergravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2022-12-13 09:11:30+01:00
logd0d845a25b897a8db37b0f60d5ec313f6b56943f
tree620e8e828fe3eedb5b68e1f31ea23179c7b66034
parentd8b4588d5fe685637ebbbb57c139aca7fb12ddf5

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.

1 files changed, 7 insertions(+), 15 deletions(-)

lib/std/debug.zig+7-15
......@@ -384,14 +384,6 @@ pub fn panicImpl(trace: ?*const std.builtin.StackTrace, first_trace_addr: ?usize
384384 os.abort();
385385}
386386
387const RED = "\x1b[31;1m";
388const GREEN = "\x1b[32;1m";
389const CYAN = "\x1b[36;1m";
390const WHITE = "\x1b[37;1m";
391const BOLD = "\x1b[1m";
392const DIM = "\x1b[2m";
393const RESET = "\x1b[0m";
394
395387pub fn writeStackTrace(
396388 stack_trace: std.builtin.StackTrace,
397389 out_stream: anytype,
......@@ -615,13 +607,13 @@ pub const TTY = struct {
615607 .no_color => return,
616608 .escape_codes => {
617609 const color_string = switch (color) {
618 .Red => RED,
619 .Green => GREEN,
620 .Cyan => CYAN,
621 .White => WHITE,
622 .Dim => DIM,
623 .Bold => BOLD,
624 .Reset => RESET,
610 .Red => "\x1b[31;1m",
611 .Green => "\x1b[32;1m",
612 .Cyan => "\x1b[36;1m",
613 .White => "\x1b[37;1m",
614 .Bold => "\x1b[1m",
615 .Dim => "\x1b[2m",
616 .Reset => "\x1b[0m",
625617 };
626618 try out_stream.writeAll(color_string);
627619 },