mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 09:49:30 +01:00
Upgrade kotlin to 1.6.21
Also fix a collection of warnings.
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
package org.thoughtcrime.securesms.util.rx
|
||||
|
||||
import com.google.android.gms.tasks.Task
|
||||
import io.reactivex.rxjava3.core.Single
|
||||
|
||||
/**
|
||||
* Convert a [Task] into a [Single].
|
||||
*/
|
||||
fun <T : Any> Task<T>.toSingle(): Single<T> {
|
||||
return Single.create { emitter ->
|
||||
addOnCompleteListener {
|
||||
if (it.isSuccessful && !emitter.isDisposed) {
|
||||
emitter.onSuccess(it.result)
|
||||
} else if (!emitter.isDisposed) {
|
||||
emitter.onError(it.exception)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user