mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-09 22:43:34 +00:00
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".
(cherry picked from commit c9c28bf85e)
This commit is contained in:
@@ -392,7 +392,7 @@ proc clear*(n: var XmlNode) =
|
||||
|
||||
|
||||
iterator items*(n: XmlNode): XmlNode {.inline.} =
|
||||
## Iterates over any child of `n`.
|
||||
## Iterates over all direct children of `n`.
|
||||
##
|
||||
## **Examples:**
|
||||
##
|
||||
@@ -417,7 +417,7 @@ iterator items*(n: XmlNode): XmlNode {.inline.} =
|
||||
for i in 0 .. n.len-1: yield n[i]
|
||||
|
||||
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
|
||||
for i in 0 .. n.len-1: yield n[i]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user