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:
Etan Kissling 2024-02-28 23:03:04 +01:00 committed by GitHub
parent d8209f623f
commit d66a29db7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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))