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(
times: Int,
crossinline onEachFailure: (Throwable) -> Unit = {},
crossinline action: (Int) -> R
onEachFailure: (Throwable) -> Unit = {},
action: (Int) -> R
): Optional<R> {
repeat(times) {
runCatching {