Skip to content

Commit

Permalink
Adapt to changes in Nim compiler/stdlib from (I *think*...)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-blake committed Jan 1, 2024
1 parent 9753f58 commit cf81d58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nio.nim
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ proc makeSuffix[T](result: var string, x: T, inArray=false) =
result.makeSuffix x, inArray=true
else:
try :result.add nim2nio[$type(T)]
except Ce:raise newException(ValueError,"missing type key: "&repr($type(T)))
except Ce:raise newException(ValueError,"missing type key: " &
(when (NimMajor,NimMinor) < (2,1): repr($type(T)) else: T.repr))

proc makeName[T](result: var string, key: string, x: T, sep=",") =
when T is tuple or T is object:
Expand Down Expand Up @@ -634,7 +635,7 @@ proc `[]`*(at: Repo, i: Ix): string =
p = cast[pointer](cast[uint](at.m.mem) + i)
let e = c_memchr(p, at.dlm.cint, csize_t(at.m.size.Ix - i))
if e == nil:
raise newException(ValueError, &"no terminating delimiter for {i}")
raise newException(ValueError, &"no terminating delimiter for {i.int}")
n = Ix(cast[uint](e) - cast[uint](p))
of rkLenPfx: # Here `i` is a byte offset to length field
let pL = cast[pointer](cast[uint](at.m.mem) + i)
Expand Down

0 comments on commit cf81d58

Please sign in to comment.