'nil' as a statement is deprecated, use an empty 'discard' instead

This commit is contained in:
Araq 2014-01-19 16:54:59 +01:00
commit 73c6efdf66
54 changed files with 170 additions and 170 deletions

View file

@ -626,7 +626,7 @@ proc len*(n: PJsonNode): int =
case n.kind
of JArray: result = n.elems.len
of JObject: result = n.fields.len
else: nil
else: discard
proc `[]`*(node: PJsonNode, name: string): PJsonNode =
## Gets a field from a `JObject`. Returns nil if the key is not found.
@ -646,6 +646,7 @@ proc hasKey*(node: PJsonNode, key: string): bool =
assert(node.kind == JObject)
for k, item in items(node.fields):
if k == key: return true
proc existsKey*(node: PJsonNode, key: string): bool {.deprecated.} = node.hasKey(key)
## Deprecated for `hasKey`