Change stdlib imports to use std prefix in most examples (#17202)
This commit is contained in:
parent
26a6ceb34e
commit
56461c280f
45 changed files with 127 additions and 127 deletions
|
|
@ -31,7 +31,7 @@
|
|||
## ----------------------------------
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## import db_mysql
|
||||
## import std/db_mysql
|
||||
## let db = open("localhost", "user", "password", "dbname")
|
||||
## db.close()
|
||||
##
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
##
|
||||
## .. code-block:: Nim
|
||||
##
|
||||
## import db_mysql, math
|
||||
## import std/[db_mysql, math]
|
||||
##
|
||||
## let theDb = open("localhost", "nim", "nim", "test")
|
||||
##
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
## ----------------------------------
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## import db_odbc
|
||||
## import std/db_odbc
|
||||
## var db = open("localhost", "user", "password", "dbname")
|
||||
## db.close()
|
||||
##
|
||||
|
|
@ -62,7 +62,7 @@
|
|||
##
|
||||
## .. code-block:: Nim
|
||||
##
|
||||
## import db_odbc, math
|
||||
## import std/[db_odbc, math]
|
||||
##
|
||||
## var theDb = open("localhost", "nim", "nim", "test")
|
||||
##
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
## To use Unix sockets with `db_postgres`, change the server address to the socket file path:
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## import db_postgres ## Change "localhost" or "127.0.0.1" to the socket file path
|
||||
## import std/db_postgres ## Change "localhost" or "127.0.0.1" to the socket file path
|
||||
## let db = db_postgres.open("/run/postgresql", "user", "password", "database")
|
||||
## echo db.getAllRows(sql"SELECT version();")
|
||||
## db.close()
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
## ----------------------------------
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## import db_postgres
|
||||
## import std/db_postgres
|
||||
## let db = open("localhost", "user", "password", "dbname")
|
||||
## db.close()
|
||||
##
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
##
|
||||
## .. code-block:: Nim
|
||||
##
|
||||
## import db_sqlite
|
||||
## import std/db_sqlite
|
||||
##
|
||||
## # user, password, database name can be empty.
|
||||
## # These params are not used on db_sqlite module.
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
##
|
||||
## .. code-block:: nim
|
||||
##
|
||||
## import db_sqlite, math
|
||||
## import std/[db_sqlite, math]
|
||||
##
|
||||
## let db = open("mytest.db", "", "", "")
|
||||
##
|
||||
|
|
@ -99,7 +99,7 @@
|
|||
##
|
||||
## .. code-block:: nim
|
||||
##
|
||||
## import random
|
||||
## import std/random
|
||||
##
|
||||
## ## Generate random float datas
|
||||
## var orig = newSeq[float64](150)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ when defined(js):
|
|||
##
|
||||
## .. code-block:: nim
|
||||
##
|
||||
## import nre except toSeq
|
||||
## import std/nre except toSeq
|
||||
##
|
||||
##
|
||||
## Licencing
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ proc match*(s: string, pattern: Regex, matches: var openArray[string],
|
|||
## returned.
|
||||
##
|
||||
runnableExamples:
|
||||
import sequtils
|
||||
import std/sequtils
|
||||
var matches: array[2, string]
|
||||
if match("abcdefg", re"c(d)ef(g)", matches, 2):
|
||||
doAssert toSeq(matches) == @["d", "g"]
|
||||
|
|
@ -494,7 +494,7 @@ iterator split*(s: string, sep: Regex; maxsplit = -1): string =
|
|||
## Substrings are separated by the regular expression `sep`
|
||||
## (and the portion matched by `sep` is not returned).
|
||||
runnableExamples:
|
||||
import sequtils
|
||||
import std/sequtils
|
||||
doAssert toSeq(split("00232this02939is39an22example111", re"\d+")) ==
|
||||
@["", "this", "is", "an", "example", ""]
|
||||
var last = 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue