mirror of
https://github.com/status-im/nim-rocksdb.git
synced 2025-02-16 17:07:40 +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:
|
||||
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…
x
Reference in New Issue
Block a user