diff options
author | hlaaftana <10591326+hlaaftana@users.noreply.github.com> | 2021-01-03 10:02:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-03 08:02:12 +0100 |
commit | 2aed4186989e0c9192eadcc28f989d41f92237b0 (patch) | |
tree | 7e0e8255c097f5e7c9855d7672e9b067ffdd55f5 | |
parent | c71f5650c65026cf7c213b3a508fc16e89bc1ad2 (diff) | |
download | Nim-2aed4186989e0c9192eadcc28f989d41f92237b0.tar.gz |
Fix #16554 (#16564)
-rw-r--r-- | lib/pure/collections/critbits.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/pure/collections/critbits.nim b/lib/pure/collections/critbits.nim index 695f44646..a4e727909 100644 --- a/lib/pure/collections/critbits.nim +++ b/lib/pure/collections/critbits.nim @@ -531,13 +531,14 @@ func commonPrefixLen*[T](c: CritBitTree[T]): int {.inline, since((1, 3)).} = else: c.root.byte else: 0 -func toCritBitTree*[A, B](pairs: openArray[(A, B)]): CritBitTree[A] {.since: (1, 3).} = +func toCritBitTree*[T](pairs: openArray[(string, T)]): CritBitTree[T] {.since: (1, 3).} = ## Creates a new `CritBitTree` that contains the given `pairs`. runnableExamples: doAssert {"a": "0", "b": "1", "c": "2"}.toCritBitTree is CritBitTree[string] + doAssert {"a": 0, "b": 1, "c": 2}.toCritBitTree is CritBitTree[int] for item in pairs: result.incl item[0], item[1] -func toCritBitTree*[T](items: openArray[T]): CritBitTree[void] {.since: (1, 3).} = +func toCritBitTree*(items: openArray[string]): CritBitTree[void] {.since: (1, 3).} = ## Creates a new `CritBitTree` that contains the given `items`. runnableExamples: doAssert ["a", "b", "c"].toCritBitTree is CritBitTree[void] |