mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2026-11-01 09:33:05 +00:00
fix of build
This commit is contained in:
1 parent
e661185534
commit
90247667d1
3 files changed
+9
-7
No files matched your search
@@ -5,7 +5,9 @@ import dev.inmo.micro_utils.coroutines.runCatchingSafely
|
||||
interface SafeWrapper<T> {
|
||||
fun <R> safe(block: T.() -> R): Result<R> = unsafeTarget().runCatching(block)
|
||||
fun <R> unsafe(block: T.() -> R): R = unsafeTarget().block()
|
||||
suspend fun <R> safeS(block: suspend T.() -> R): Result<R> = unsafeTarget().runCatchingSafely(block = block)
|
||||
suspend fun <R> safeS(block: suspend T.() -> R): Result<R> = unsafeTarget().run {
|
||||
runCatchingSafely(block = { block() })
|
||||
}
|
||||
suspend fun <R> unsafeS(block: suspend T.() -> R): R = unsafeTarget().block()
|
||||
fun unsafeTarget(): T
|
||||
|
||||
|
||||
Reference in new issue
Block a user