mirror of
https://github.com/status-im/nim-rocksdb.git
synced 2025-02-19 18:38:15 +00:00
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:
|
else:
|
||||||
error*: string
|
error*: string
|
||||||
|
|
||||||
proc `$`*(s: RocksDBResult): string =
|
proc `$`*[T](s: RocksDBResult[T]): string =
|
||||||
if s.ok:
|
if s.ok:
|
||||||
$s.value
|
when T isnot void:
|
||||||
|
$s.value
|
||||||
|
else:
|
||||||
|
""
|
||||||
else:
|
else:
|
||||||
"(error) " & s.error
|
"(error) " & s.error
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user