Skip to content

Commit

Permalink
fix: use serializers from the module in decodeFromYamlNode (#636)
Browse files Browse the repository at this point in the history
  • Loading branch information
sschuberth authored Oct 30, 2024
1 parent 9bee143 commit 3ec93d8
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/commonMain/kotlin/com/charleskorn/kaml/Yaml.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 42,7 @@ public class Yaml(
}

public inline fun <reified T> decodeFromYamlNode(node: YamlNode): T =
decodeFromYamlNode(serializer<T>(), node)
decodeFromYamlNode(serializersModule.serializer<T>(), node)

public fun <T> decodeFromYamlNode(
deserializer: DeserializationStrategy<T>,
Expand All @@ -52,9 52,6 @@ public class Yaml(
return input.decodeSerializableValue(deserializer)
}

public inline fun <reified T> decodeFromString(string: String): T =
decodeFromString(serializersModule.serializer<T>(), string)

override fun <T> decodeFromString(
deserializer: DeserializationStrategy<T>,
string: String,
Expand Down Expand Up @@ -98,9 95,6 @@ public class Yaml(
encodeToBufferedSink(serializer, value, sink.buffer())
}

public inline fun <reified T> encodeToString(value: T): String =
encodeToString(serializersModule.serializer<T>(), value)

override fun <T> encodeToString(
serializer: SerializationStrategy<T>,
value: T,
Expand Down

0 comments on commit 3ec93d8

Please sign in to comment.