From 7a0c5f3c849804245d1f48da024ba4b6c0619cd1 Mon Sep 17 00:00:00 2001 From: bptato Date: Fri, 9 Aug 2024 19:51:58 +0200 Subject: twtstr: don't cast in parseEnum Nim 1.6 does not like it. --- src/utils/twtstr.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/utils/twtstr.nim') 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(';') -- cgit 1.4.1-2-gfad0