Skip to content

Commit

Permalink
Fix Serialization in readme to use encodeToString instead of wrong de…
Browse files Browse the repository at this point in the history
…codeFromString (#253)
  • Loading branch information
vlsi authored Jan 14, 2024
1 parent 552d681 commit 8baee81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ val resultFromList = TomlFileReader.partiallyDecodeFromSource<MyClass>(serialize

```kotlin
// add extensions from 'kotlinx' lib to your project:
import kotlinx.serialization.encodeFromString
import kotlinx.serialization.encodeToString
// add com.akuleshov7:ktoml-core to your project:
import com.akuleshov7.ktoml.Toml

@Serializable
data class MyClass(/* your fields */)

val toml = Toml.decodeFromString(MyClass(/* ... */))
val toml = Toml.encodeToString(MyClass(/* ... */))
```
</details>

Expand Down

0 comments on commit 8baee81

Please sign in to comment.