diff options
author | bptato <nincsnevem662@gmail.com> | 2023-11-20 17:20:41 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-11-20 17:20:41 +0100 |
commit | 342a1a7f787fc260448842ee312cf29825f96ba6 (patch) | |
tree | e4e1d28e424e60da8b2618195c40442b79bd2ba8 /src/config/mimetypes.nim | |
parent | d20fc30e10aeecfb2ede7adc4547b9ae394565b9 (diff) | |
download | chawan-342a1a7f787fc260448842ee312cf29825f96ba6.tar.gz |
twtstr: remove tolower, isWhitespace
* tolower: strutils toLowerAscii is good enough for the cases where we need it. Also, it's easy to confuse with unicode toLower and vice versa. * isWhitespace: in AsciiWhitespace is more idiomatic. Also has a naming collision with unicode toLower.
Diffstat (limited to 'src/config/mimetypes.nim')
-rw-r--r-- | src/config/mimetypes.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/config/mimetypes.nim b/src/config/mimetypes.nim index 2133d863..577fcbed 100644 --- a/src/config/mimetypes.nim +++ b/src/config/mimetypes.nim @@ -1,4 +1,5 @@ import streams +import strutils import tables import utils/twtstr @@ -18,7 +19,7 @@ proc parseMimeTypes*(mimeTypes: var MimeTypes, stream: Stream) = var t = "" var i = 0 while i < line.len and line[i] notin AsciiWhitespace: - t &= line[i].tolower() + t &= line[i].toLowerAscii() inc i if t == "": continue while i < line.len: @@ -26,7 +27,7 @@ proc parseMimeTypes*(mimeTypes: var MimeTypes, stream: Stream) = inc i var ext = "" while i < line.len and line[i] notin AsciiWhitespace: - ext &= line[i].tolower() + ext &= line[i].toLowerAscii() inc i if ext == "": continue discard mimeTypes.hasKeyOrPut(ext, t) |