Kotlin 1.9.0 (#3835)
Update to Kotlin 1.9.0 and migrate to newer language idioms. - Remove unnecessary @OptIn for features migrated to mainstream - Use `data object` where appropriate - Use new enum `entries` property
This commit is contained in:
parent
5391b5f797
commit
40bd95d752
29 changed files with 44 additions and 71 deletions
|
|
@ -20,7 +20,6 @@ package com.keylesspalace.tusky.util
|
|||
import kotlinx.coroutines.flow.Flow
|
||||
import kotlinx.coroutines.flow.flow
|
||||
import kotlin.time.Duration
|
||||
import kotlin.time.ExperimentalTime
|
||||
import kotlin.time.TimeMark
|
||||
import kotlin.time.TimeSource
|
||||
|
||||
|
|
@ -54,7 +53,6 @@ import kotlin.time.TimeSource
|
|||
* @param timeout Emissions within this duration of the last emission are filtered
|
||||
* @param timeSource Used to measure elapsed time. Normally only overridden in tests
|
||||
*/
|
||||
@OptIn(ExperimentalTime::class)
|
||||
fun <T> Flow<T>.throttleFirst(
|
||||
timeout: Duration,
|
||||
timeSource: TimeSource = TimeSource.Monotonic
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import android.text.TextPaint
|
|||
import android.text.style.URLSpan
|
||||
import android.view.View
|
||||
|
||||
open class NoUnderlineURLSpan constructor(val url: String) : URLSpan(url) {
|
||||
open class NoUnderlineURLSpan(val url: String) : URLSpan(url) {
|
||||
|
||||
// This should not be necessary. But if you don't do this the [StatusLengthTest] tests
|
||||
// fail. Without this, accessing the `url` property, or calling `getUrl()` (which should
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ private fun findPattern(string: String, fromIndex: Int): FindCharsResult {
|
|||
val result = FindCharsResult()
|
||||
for (i in fromIndex..string.lastIndex) {
|
||||
val c = string[i]
|
||||
for (matchType in FoundMatchType.values()) {
|
||||
for (matchType in FoundMatchType.entries) {
|
||||
val finder = finders[matchType]
|
||||
if (finder!!.searchCharacter == c &&
|
||||
(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue