mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-03 15:19:44 +00:00
safely fixes
This commit is contained in:
@@ -10,21 +10,6 @@ import kotlin.coroutines.Continuation
|
||||
import kotlin.coroutines.resume
|
||||
import kotlin.coroutines.resumeWithException
|
||||
|
||||
private data class CallbackContinuationPair<T> (
|
||||
val callback: suspend SQLiteDatabase.() -> T,
|
||||
val continuation: Continuation<T>
|
||||
) {
|
||||
suspend fun SQLiteDatabase.execute() {
|
||||
safely(
|
||||
{
|
||||
continuation.resumeWithException(it)
|
||||
}
|
||||
) {
|
||||
continuation.resume(callback())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class StandardSQLHelper(
|
||||
context: Context,
|
||||
name: String,
|
||||
|
Reference in New Issue
Block a user