diff options
author | Zoffix Znet <cpan@zoffix.com> | 2017-05-30 19:07:55 -0400 |
---|---|---|
committer | Zoffix Znet <cpan@zoffix.com> | 2017-05-30 19:07:55 -0400 |
commit | 07264216dfb1ba527e5aaced7677483df0dae2df (patch) | |
tree | 2d609967eb05fb4169ccef8593642fa5aaf05050 /lib | |
parent | 3ac41c2b68788b01c5722e8a28e279ef0c3203bb (diff) |
Fix colorization
Diffstat (limited to 'lib')
-rw-r--r-- | lib/IRC/Client.pm6 | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index e5696b4..400a326 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -20,17 +20,9 @@ has Lock $!lock = Lock.new; has Channel $!event-pipe = Channel.new; has Channel $!socket-pipe = Channel.new; -my &colored = get-colored; -&colored //= sub (Str $s, $) { $s }; - -sub get-colored { - my &colored; - try { - require Terminal::ANSIColor; - &colored = GLOBAL::Terminal::ANSIColor::EXPORT::DEFAULT::<&colored>; - } - &colored; -} +my &colored = (try require Terminal::ANSIColor) === Nil + && sub (Str $s, $) { $s } || + ::('Terminal::ANSIColor::EXPORT::DEFAULT::&colored'); submethod BUILD ( Int:D :$!debug = 0, |