about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-04-10 00:49:59 +0200
committerbptato <nincsnevem662@gmail.com>2024-04-10 00:51:48 +0200
commit28101d383ed2f7733af0998cc4018c64a1e94e13 (patch)
treed4fb084617314999f026aa16e5c7922be1c9acdb /src
parentb5081e76373b27f38caa1f1f202aa7f368013a8a (diff)
downloadchawan-28101d383ed2f7733af0998cc4018c64a1e94e13.tar.gz
url: use AsciiDigit, not Digits
Diffstat (limited to 'src')
-rw-r--r--src/types/url.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/types/url.nim b/src/types/url.nim
index 10394020..e73d5f83 100644
--- a/src/types/url.nim
+++ b/src/types/url.nim
@@ -126,9 +126,9 @@ func parseIpv6(input: string): Option[array[8, uint16]] =
             inc pointer
           else:
             return failure
-        if not has or c notin Digits:
+        if not has or c notin AsciiDigit:
           return failure
-        while has and c in Digits:
+        while has and c in AsciiDigit:
           if ipv4piece == -1:
             ipv4piece = c.decValue
           elif ipv4piece == 0:
@@ -238,10 +238,10 @@ func endsInNumber(input: string): bool =
   if parts.len == 0: return false
   var last = parts[^1]
   if last != "":
-    if last.len == 2 and last[0] in Digits and last[1].toLowerAscii() == 'x':
+    if last.len == 2 and last[0] in AsciiDigit and last[1] in {'x', 'X'}:
       last = last.substr(2)
     for c in last:
-      if c notin Digits:
+      if c notin AsciiDigit:
         return false
     return true
   return false
@@ -661,7 +661,7 @@ proc basicParseURL*(input: string, base = none(URL), url: URL = URL(),
           insidebrackets = false
         buffer &= c
     of PORT_STATE:
-      if has and c in Digits:
+      if has and c in AsciiDigit:
         buffer &= c
       elif (not has or c in {'/', '?', '#'}) or
         (url.is_special and c == '\\') or override: