Update RepeatOnFailure.kt

This commit is contained in:
2021-11-26 23:07:00 +06:00
committed by GitHub
parent 527a2a91ac
commit 3a5771a0cc

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 {