I have this code:
proc encode*(s: openArray[int], lo: var int): seq[byte] =
var mlength = findMaxLen(s, true)
mlength = mlength.binLen + 1
var cache = ""
for i in s:
cache &= toBin(i, mlength)
lo = mlength
result.add binToInt(cache)
proc encode*(s: openArray[int]): seq[byte] =
var tmp: int
result = s.encode(tmp)
result.insert(tmp, 0)
I get type mismatch for this line: result.insert(tmp, 0). It wants sink T but got int, any ideas on how to fix this?