fix string conversion for void results
value does not exist for void
This commit is contained in:
parent
4675336fae
commit
d510091a5b
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue