fix string conversion for void results

value does not exist for void
This commit is contained in:
Jacek Sieka 2018-08-15 19:52:53 -06:00
parent 4675336fae
commit d510091a5b
No known key found for this signature in database
GPG Key ID: 6299FEB3EB6FA465
1 changed files with 5 additions and 2 deletions

View File

@ -70,9 +70,12 @@ type
else:
error*: string
proc `$`*(s: RocksDBResult): string =
proc `$`*[T](s: RocksDBResult[T]): string =
if s.ok:
$s.value
when T isnot void:
$s.value
else:
""
else:
"(error) " & s.error