Skip to content

Commit 9211a0c

Browse files
committed
Opt-in to UnsafeResultErrorAccess in retry result
1 parent fa5af44 commit 9211a0c

File tree

1 file changed

+2
-0
lines changed
  • kotlin-retry-result/src/commonMain/kotlin/com/github/michaelbull/retry/result

1 file changed

+2
-0
lines changed

kotlin-retry-result/src/commonMain/kotlin/com/github/michaelbull/retry/result/Retry.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.github.michaelbull.retry.result
22

33
import com.github.michaelbull.result.Err
44
import com.github.michaelbull.result.Result
5+
import com.github.michaelbull.result.annotation.UnsafeResultErrorAccess
56
import com.github.michaelbull.result.asErr
67
import com.github.michaelbull.retry.attempt.Attempt
78
import com.github.michaelbull.retry.attempt.firstAttempt
@@ -17,6 +18,7 @@ import kotlin.contracts.contract
1718
* Calls the specified function [block] and returns its [Result], handling any [Err] returned from the [block] function
1819
* execution retrying the invocation according to [instructions][RetryInstruction] from the [policy].
1920
*/
21+
@OptIn(UnsafeResultErrorAccess::class)
2022
public suspend inline fun <V, E> retry(policy: RetryPolicy<E>, block: () -> Result<V, E>): Result<V, E> {
2123
contract {
2224
callsInPlace(block, InvocationKind.AT_LEAST_ONCE)

0 commit comments

Comments
 (0)