Update documentation on xmltree.items/mitems (#11930)
* Update documentation on `xmltree.items`/`mitems` So far the documentation on `items` and `mitems` wasn't explicit about whether the iteration recurses down the node's children or not. I assumed recursion, which was wrong. * Improve wording in comment Use the more common and shorter word "direct".
This commit is contained in:
parent
da64c8762f
commit
c9c28bf85e
1 changed files with 2 additions and 2 deletions
|
|
@ -392,7 +392,7 @@ proc clear*(n: var XmlNode) =
|
||||||
|
|
||||||
|
|
||||||
iterator items*(n: XmlNode): XmlNode {.inline.} =
|
iterator items*(n: XmlNode): XmlNode {.inline.} =
|
||||||
## Iterates over any child of `n`.
|
## Iterates over all direct children of `n`.
|
||||||
##
|
##
|
||||||
## **Examples:**
|
## **Examples:**
|
||||||
##
|
##
|
||||||
|
|
@ -417,7 +417,7 @@ iterator items*(n: XmlNode): XmlNode {.inline.} =
|
||||||
for i in 0 .. n.len-1: yield n[i]
|
for i in 0 .. n.len-1: yield n[i]
|
||||||
|
|
||||||
iterator mitems*(n: var XmlNode): var XmlNode {.inline.} =
|
iterator mitems*(n: var XmlNode): var XmlNode {.inline.} =
|
||||||
## Iterates over any child of `n` so that it can be modified.
|
## Iterates over all direct children of `n` so that they can be modified.
|
||||||
assert n.k == xnElement
|
assert n.k == xnElement
|
||||||
for i in 0 .. n.len-1: yield n[i]
|
for i in 0 .. n.len-1: yield n[i]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue