From 8baee815e9e74f4fc94cb54bbbddd44a18fa3d9e Mon Sep 17 00:00:00 2001 From: Vladimir Sitnikov Date: Sun, 14 Jan 2024 17:54:26 +0300 Subject: [PATCH] Fix Serialization in readme to use encodeToString instead of wrong decodeFromString (#253) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index daf3d25f..e98d3003 100644 --- a/README.md +++ b/README.md @@ -201,14 +201,14 @@ val resultFromList = TomlFileReader.partiallyDecodeFromSource(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(/* ... */)) ```