diff options
author | nea <nea@nea.moe> | 2023-05-31 00:46:23 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-05-31 00:46:23 +0200 |
commit | a24a74fa2351d53693226ba0d0018fb9589cddc9 (patch) | |
tree | 4dc69bd90130f1755e75960251f5ca41701f84cf /src/main/kotlin/moe/nea/firmament/util | |
parent | 88cb9468b4432f68d1197f512f68c951fdbdf3dd (diff) | |
download | Firmament-a24a74fa2351d53693226ba0d0018fb9589cddc9.tar.gz Firmament-a24a74fa2351d53693226ba0d0018fb9589cddc9.tar.bz2 Firmament-a24a74fa2351d53693226ba0d0018fb9589cddc9.zip |
[WIP] Add really shitty pv. This is mostly so I have something to be bothered to improve
Diffstat (limited to 'src/main/kotlin/moe/nea/firmament/util')
-rw-r--r-- | src/main/kotlin/moe/nea/firmament/util/json/DashlessUUIDSerializer.kt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/kotlin/moe/nea/firmament/util/json/DashlessUUIDSerializer.kt b/src/main/kotlin/moe/nea/firmament/util/json/DashlessUUIDSerializer.kt index c95b343..3dca217 100644 --- a/src/main/kotlin/moe/nea/firmament/util/json/DashlessUUIDSerializer.kt +++ b/src/main/kotlin/moe/nea/firmament/util/json/DashlessUUIDSerializer.kt @@ -2,7 +2,6 @@ package moe.nea.firmament.util.json import java.util.UUID import kotlinx.serialization.KSerializer -import kotlinx.serialization.Serializer import kotlinx.serialization.descriptors.PrimitiveKind import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor import kotlinx.serialization.descriptors.SerialDescriptor @@ -15,7 +14,11 @@ object DashlessUUIDSerializer : KSerializer<UUID> { PrimitiveSerialDescriptor("DashlessUUIDSerializer", PrimitiveKind.STRING) override fun deserialize(decoder: Decoder): UUID { - return parseDashlessUUID(decoder.decodeString()) + val str = decoder.decodeString() + if ("-" in str) { + return UUID.fromString(str) + } + return parseDashlessUUID(str) } override fun serialize(encoder: Encoder, value: UUID) { |