mirror of https://github.com/status-im/nim-eth.git
avoid `XDeclaredButNotUsed` in `kvstore_sqlite3` with empty tuple (#680)
Suppresses an annoying hint that gets triggered when `params is tuple` but it's an empty tuple without fields. ``` Hint: 'i' is declared but not used [XDeclaredButNotUsed] ```
This commit is contained in:
parent
d8209f623f
commit
d66a29db7c
|
@ -248,7 +248,7 @@ iterator exec*[Params, Res](s: SqliteStmt[Params, Res],
|
||||||
# `yield` statements cause when inlining the loop body
|
# `yield` statements cause when inlining the loop body
|
||||||
var res = KvResult[void].ok()
|
var res = KvResult[void].ok()
|
||||||
when params is tuple:
|
when params is tuple:
|
||||||
var i = 1
|
var i {.used.} = 1
|
||||||
for param in fields(params):
|
for param in fields(params):
|
||||||
if (let v = bindParam(s, i, param); v != SQLITE_OK):
|
if (let v = bindParam(s, i, param); v != SQLITE_OK):
|
||||||
res = KvResult[void].err(toErrorString(s.env, v))
|
res = KvResult[void].err(toErrorString(s.env, v))
|
||||||
|
|
Loading…
Reference in New Issue