Fix "unused variable" warnings

This commit is contained in:
Mark Spanbroek 2021-07-07 09:19:44 +02:00
parent 4a1783c472
commit 8feb684574
1 changed files with 2 additions and 2 deletions

View File

@ -7,12 +7,12 @@ proc option[T](option: Option[T]): Option[T] =
template bindLet(name, expression): bool =
let option = expression.option
const default = typeof(option.unsafeGet()).default
let name = if option.isSome: option.unsafeGet() else: default
let name {.used.} = if option.isSome: option.unsafeGet() else: default
option.isSome
template bindVar(name, expression): bool =
let option = expression.option
var name : typeof(option.unsafeGet())
var name {.used.} : typeof(option.unsafeGet())
if option.isSome:
name = option.unsafeGet()
option.isSome