mirror of
https://github.com/jellyfin/jellyfin-android.git
synced 2026-10-26 16:45:26 +00:00
Merge pull request #400 from jellyfin/kt-1510
Update Kotlin to 1.5.10 and revert obsolete workaround
This commit is contained in:
2 files changed
+1
-27
No files matched your search
@@ -1,26 +0,0 @@
|
||||
package org.jellyfin.mobile.player.source
|
||||
|
||||
class Result<T> private constructor(
|
||||
val value: T?,
|
||||
val error: Throwable?,
|
||||
) {
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun getOrNull(): T? = value
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
inline fun onSuccess(action: (T) -> Unit): Result<T> {
|
||||
if (error == null) action(value as T)
|
||||
return this
|
||||
}
|
||||
|
||||
inline fun onFailure(action: (Throwable) -> Unit): Result<T> {
|
||||
if (error != null) action(error)
|
||||
return this
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun <T> success(value: T) = Result(value, null)
|
||||
|
||||
fun <T> failure(error: Throwable) = Result<T>(null, error)
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -19,6 +19,6 @@ android.enableJetifier=true
|
||||
# Kotlin code style for this project: "official" or "obsolete":
|
||||
kotlin.code.style=official
|
||||
# Kotlin version for this project
|
||||
kotlinVersion=1.5.0
|
||||
kotlinVersion=1.5.10
|
||||
# Use snapshot release of Jellyfin SDK
|
||||
useSdkSnapshot=false
|
||||
Reference in new issue
Block a user