use OrderedTable instead of OrderedTableRef for mimedb (#19522)

* use OrderedTable instead of OrderedTableRef for mimedb

Signed-off-by: David Krause <enthus1ast@users.noreply.github.com>

* added changelog entry for mimedb change

Signed-off-by: David Krause <enthus1ast@users.noreply.github.com>
This commit is contained in:
David Krause
2022-02-14 08:56:35 +01:00
committed by GitHub
parent 551225d888
commit cda77c1520
3 changed files with 6 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ from strutils import startsWith, toLowerAscii, strip
type
MimeDB* = object
mimes: OrderedTableRef[string, string]
mimes: OrderedTable[string, string]
const mimes* = {
"123": "application/vnd.lotus-1-2-3",
@@ -1904,7 +1904,7 @@ func newMimetypes*(): MimeDB =
## Creates a new Mimetypes database. The database will contain the most
## common mimetypes.
{.cast(noSideEffect).}:
result.mimes = mimes.newOrderedTable()
result.mimes = mimes.toOrderedTable()
func getMimetype*(mimedb: MimeDB, ext: string, default = "text/plain"): string =
## Gets mimetype which corresponds to `ext`. Returns `default` if `ext`