From 342a1a7f787fc260448842ee312cf29825f96ba6 Mon Sep 17 00:00:00 2001 From: bptato Date: Mon, 20 Nov 2023 17:20:41 +0100 Subject: 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. --- src/config/mimetypes.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/config/mimetypes.nim') 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) -- cgit 1.4.1-2-gfad0 class='form'>
path: root/widgets/headerlayout.go
blob: c6e61615dc2d4cc316dc6b711d5359f4362bdea8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41