minor code cleanups (#21215)
This commit is contained in:
parent
e9ed090c33
commit
cf1b16ef8b
6 changed files with 32 additions and 36 deletions
|
|
@ -21,7 +21,7 @@ macro enumerate*(x: ForLoopStmt): untyped {.since: (1, 3).} =
|
|||
## The default starting count `0` can be manually overridden if needed.
|
||||
runnableExamples:
|
||||
let a = [10, 20, 30]
|
||||
var b: seq[(int, int)]
|
||||
var b: seq[(int, int)] = @[]
|
||||
for i, x in enumerate(a):
|
||||
b.add((i, x))
|
||||
assert b == @[(0, 10), (1, 20), (2, 30)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue