Update RepeatOnFailure.kt

This commit is contained in:
InsanusMokrassar 2021-11-26 23:07:00 +06:00 committed by GitHub
parent 527a2a91ac
commit 3a5771a0cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,8 +7,8 @@ package dev.inmo.micro_utils.common
*/ */
inline fun <R> repeatOnFailure( inline fun <R> repeatOnFailure(
times: Int, times: Int,
crossinline onEachFailure: (Throwable) -> Unit = {}, onEachFailure: (Throwable) -> Unit = {},
crossinline action: (Int) -> R action: (Int) -> R
): Optional<R> { ): Optional<R> {
repeat(times) { repeat(times) {
runCatching { runCatching {