diff --git a/python/openapi/src/com/jetbrains/python/Result.kt b/python/openapi/src/com/jetbrains/python/Result.kt index bd84937b508a..9190f0aec86e 100644 --- a/python/openapi/src/com/jetbrains/python/Result.kt +++ b/python/openapi/src/com/jetbrains/python/Result.kt @@ -186,3 +186,9 @@ val Result.isFailure: Boolean get() = this is Failure val Result.isSuccess: Boolean get() = this is Success fun Result.getOrThrow(): S = orThrow() + +/** + * See [Result.mapSuccess] + */ +inline fun Iterable>.mapError(code: (E) -> E2): List> = + map { it.mapError(code) }