Skip to content

Commit 9050d1d

Browse files
Merge pull request #9 from Patitotective/devel
v2.0.1: typo in src/kdl/prefs.nim
2 parents 5cae344 + d740b66 commit 9050d1d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

kdl.nimble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Package
22

3-
version = "2.0.0"
3+
version = "2.0.1"
44
author = "Patitotective"
55
description = "KDL document language Nim implementation"
66
license = "MIT"

src/kdl/prefs.nim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ proc initKPrefs*[T](path: string, default: T, stream = false): KdlPrefs[T] =
9898

9999
if path.fileExists:
100100
if stream:
101-
parseKdlFileStream(path).decode(result.content)
101+
parseKdlFileStream(path).decodeKdl(result.content)
102102
else:
103-
parseKdlFile(path).decode(result.content)
103+
parseKdlFile(path).decodeKdl(result.content)
104104
else:
105105
result.content = default
106106

@@ -112,7 +112,7 @@ proc save*(prefs: KdlPrefs[KdlDoc]) =
112112
proc save*(prefs: KdlPrefs[auto]) =
113113
## Saves the content to the path encoding it to KDL.
114114
prefs.path.splitPath.head.createDir()
115-
prefs.path.writeFile(prefs.content.encode())
115+
prefs.path.writeFile(prefs.content.encodeKdlDoc())
116116

117117
proc removeFile*(prefs: KdlPrefs[auto]) =
118118
## Deletes the preferences file if it exists.

0 commit comments

Comments
 (0)