aboutsummaryrefslogtreecommitdiff
path: root/lib/IRC/Client.pm6
diff options
context:
space:
mode:
Diffstat (limited to 'lib/IRC/Client.pm6')
-rw-r--r--lib/IRC/Client.pm614
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,