Skip to content

Commit c4715e3

Browse files
committed
Refactor code to fix warnings on Crystal 1.19+
1 parent 49e42a3 commit c4715e3

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/debug.cr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ require "log"
22
require "colorize"
33

44
module Debug
5+
private CALLER_PATTERN = /caller:Array\(String\)/i
6+
57
{% begin %}
68
ACTIVE = {{ env("DEBUG") == "1" }}
79
{% end %}
@@ -69,11 +71,10 @@ module Debug
6971
%str << " -- "
7072

7173
when .runtime?
72-
%DEBUG_CALLER_PATTERN = /caller:Array\(String\)/i
7374
%caller_list = caller
7475

75-
if %caller_list.any?(&.match(%DEBUG_CALLER_PATTERN))
76-
while !%caller_list.empty? && %caller_list.first? !~ %DEBUG_CALLER_PATTERN
76+
if %caller_list.any?(CALLER_PATTERN)
77+
while !%caller_list.empty? && %caller_list.first? !~ CALLER_PATTERN
7778
%caller_list.shift?
7879
end
7980
%caller_list.shift?

0 commit comments

Comments
 (0)