v0.3.0 released: kotlin 2.2.21 breaking changes with Instant/Clock, etc. adopted in a compatible way
This commit is contained in:
1 parent
5357b05f4a
commit
1a46c8cab3
9 files changed
+33
-38
No files matched your search
@@ -1,6 +1,5 @@
|
||||
package net.sergeych.bipack
|
||||
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlinx.serialization.DeserializationStrategy
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.KSerializer
|
||||
@@ -12,6 +11,7 @@ import kotlinx.serialization.modules.EmptySerializersModule
|
||||
import kotlinx.serialization.modules.SerializersModule
|
||||
import kotlinx.serialization.serializer
|
||||
import net.sergeych.bintools.*
|
||||
import kotlin.time.Instant
|
||||
|
||||
/**
|
||||
* Decode BiPack format. Note that it relies on [DataSource] so can throw [DataSource.EndOfData]
|
||||
@@ -74,7 +74,7 @@ class BipackDecoder(
|
||||
}
|
||||
|
||||
override fun <T> decodeSerializableValue(deserializer: DeserializationStrategy<T>): T {
|
||||
return if (deserializer == Instant.serializer())
|
||||
return if (deserializer == serializer<Instant>())
|
||||
Instant.fromEpochMilliseconds(decodeLong()) as T
|
||||
else
|
||||
super.decodeSerializableValue(deserializer)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package net.sergeych.bipack
|
||||
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlinx.serialization.SerializationStrategy
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
import kotlinx.serialization.encoding.AbstractEncoder
|
||||
@@ -9,6 +8,7 @@ import kotlinx.serialization.modules.EmptySerializersModule
|
||||
import kotlinx.serialization.modules.SerializersModule
|
||||
import kotlinx.serialization.serializer
|
||||
import net.sergeych.bintools.*
|
||||
import kotlin.time.Instant
|
||||
|
||||
class BipackEncoder(val output: DataSink) : AbstractEncoder() {
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ package net.sergeych.collections
|
||||
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import net.sergeych.mptools.withReentrantLock
|
||||
import kotlin.time.Clock
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
import kotlin.time.Instant
|
||||
|
||||
/**
|
||||
* MRU cache with expiration, with safe async concurrent access.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package net.sergecyh.diwan.tools
|
||||
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlin.time.Clock
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Instant
|
||||
|
||||
/**
|
||||
* Value with expiration.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package net.sergecyh.diwan.tools
|
||||
|
||||
import kotlinx.datetime.Clock
|
||||
import kotlinx.datetime.Instant
|
||||
import kotlin.time.Clock
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.Instant
|
||||
|
||||
/**
|
||||
* Experimental.
|
||||
|
||||
Reference in new issue
Block a user