Change stdlib imports to use std prefix in most examples (#17202)

This commit is contained in:
Danil Yarantsev 2021-03-01 00:17:19 +03:00 • committed by GitHub
commit 56461c280f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 127 additions and 127 deletions

View file

@ -13,7 +13,7 @@
## (A crit bit tree is a form of `radix tree`:idx: or `patricia trie`:idx:.)
runnableExamples:
from sequtils import toSeq
from std/sequtils import toSeq
var critbitAsSet: CritBitTree[void] = ["kitten", "puppy"].toCritBitTree
doAssert critbitAsSet.len == 2
@ -335,7 +335,7 @@ iterator leaves[T](n: Node[T]): Node[T] =
iterator keys*[T](c: CritBitTree[T]): string =
## Yields all keys in lexicographical order.
runnableExamples:
from sequtils import toSeq
from std/sequtils import toSeq
let c = {"key1": 1, "key2": 2}.toCritBitTree
doAssert toSeq(c.keys) == @["key1", "key2"]
@ -349,7 +349,7 @@ iterator values*[T](c: CritBitTree[T]): T =
## **See also:**
## * `mvalues iterator <#mvalues.i,CritBitTree[T]>`_
runnableExamples:
from sequtils import toSeq
from std/sequtils import toSeq
let c = {"key1": 1, "key2": 2}.toCritBitTree
doAssert toSeq(c.values) == @[1, 2]
@ -375,7 +375,7 @@ iterator pairs*[T](c: CritBitTree[T]): tuple[key: string, val: T] =
## **See also:**
## * `mpairs iterator <#mpairs.i,CritBitTree[T]>`_
runnableExamples:
from sequtils import toSeq
from std/sequtils import toSeq
let c = {"key1": 1, "key2": 2}.toCritBitTree
doAssert toSeq(c.pairs) == @[(key: "key1", val: 1), (key: "key2", val: 2)]
@ -407,7 +407,7 @@ proc allprefixedAux[T](c: CritBitTree[T], key: string): Node[T] =
iterator keysWithPrefix*[T](c: CritBitTree[T], prefix: string): string =
## Yields all keys starting with `prefix`.
runnableExamples:
from sequtils import toSeq
from std/sequtils import toSeq
let c = {"key1": 42, "key2": 43}.toCritBitTree
doAssert toSeq(c.keysWithPrefix("key")) == @["key1", "key2"]
@ -422,7 +422,7 @@ iterator valuesWithPrefix*[T](c: CritBitTree[T], prefix: string): T =
## **See also:**
## * `mvaluesWithPrefix iterator <#mvaluesWithPrefix.i,CritBitTree[T],string>`_
runnableExamples:
from sequtils import toSeq
from std/sequtils import toSeq
let c = {"key1": 42, "key2": 43}.toCritBitTree
doAssert toSeq(c.valuesWithPrefix("key")) == @[42, 43]
@ -451,7 +451,7 @@ iterator pairsWithPrefix*[T](c: CritBitTree[T],
## **See also:**
## * `mpairsWithPrefix iterator <#mpairsWithPrefix.i,CritBitTree[T],string>`_
runnableExamples:
from sequtils import toSeq
from std/sequtils import toSeq
let c = {"key1": 42, "key2": 43}.toCritBitTree
doAssert toSeq(c.pairsWithPrefix("key")) == @[(key: "key1", val: 42), (key: "key2", val: 43)]