diff options
author | bptato <nincsnevem662@gmail.com> | 2024-08-09 19:51:58 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-08-09 19:51:58 +0200 |
commit | 7a0c5f3c849804245d1f48da024ba4b6c0619cd1 (patch) | |
tree | f66e5e5d3b1e5dfe214e696da0fd513be125a00e /src/utils/twtstr.nim | |
parent | 6365d9719a25abdef660868c05452dc97456aec5 (diff) | |
download | chawan-7a0c5f3c849804245d1f48da024ba4b6c0619cd1.tar.gz |
twtstr: don't cast in parseEnum
Nim 1.6 does not like it.
Diffstat (limited to 'src/utils/twtstr.nim')
-rw-r--r-- | src/utils/twtstr.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/utils/twtstr.nim b/src/utils/twtstr.nim index a5770042..81384eed 100644 --- a/src/utils/twtstr.nim +++ b/src/utils/twtstr.nim @@ -551,7 +551,7 @@ func strictParseEnum*[T: enum](s: string): Option[T] = return x[0].cmp(y) ) if i != -1: - return some(cast[T](IdentMap[i].n)) + return some(T(IdentMap[i].n)) return none(T) func parseEnumNoCase0*(map: openArray[IdentMapItem]; s: string): Opt[int] = @@ -564,7 +564,7 @@ func parseEnumNoCase0*(map: openArray[IdentMapItem]; s: string): Opt[int] = func parseEnumNoCase*[T: enum](s: string): Opt[T] = const IdentMap = getIdentMap(T) - return ok(cast[T](?IdentMap.parseEnumNoCase0(s))) + return ok(T(?IdentMap.parseEnumNoCase0(s))) proc getContentTypeAttr*(contentType, attrname: string): string = var i = contentType.find(';') |