This commit is contained in:
Dominik Picheta
2018-02-17 22:15:28 +00:00
parent 63bc046ddf
commit fe6fddb9d8
2 changed files with 3 additions and 1 deletions

View File

@@ -257,6 +257,8 @@ bar()
- The ``securehash`` module is now deprecated. Instead import ``std / sha1``.
- ``db_mysql`` module: ``DbConn`` is now a ``distinct`` type that doesn't expose the
details of the underlying ``PMySQL`` type.
- ``strtabs.getOrDefault`` now returns ``nil`` instead of ``""``. See
[#4265](https://github.com/nim-lang/Nim/issues/4265) for more info.
- Standard library modules can now also be imported via the ``std`` pseudo-directory.
This is useful in order to distinguish between standard library and nimble package
imports:

View File

@@ -129,7 +129,7 @@ proc mget*(t: StringTableRef, key: string): var string {.deprecated.} =
## ``KeyError`` exception is raised. Use ```[]``` instead.
get(t, key)
proc getOrDefault*(t: StringTableRef; key: string, default: string = ""): string =
proc getOrDefault*(t: StringTableRef; key: string, default: string = nil): string =
var index = rawGet(t, key)
if index >= 0: result = t.data[index].val
else: result = default