minor code cleanups (#21215)

This commit is contained in:
Andreas Rumpf 2023-01-02 10:39:17 +01:00 • committed by GitHub
commit cf1b16ef8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 36 deletions

View file

@ -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)]