Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Aug 8, 2023
1 parent 47f7813 commit 46fd977
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/slack/eithernet/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ public fun <T : Any, E : Any> ApiResult<T, E>.successOrNull(): T? =
else -> null
}

/** If [ApiResult.Success], returns the underlying [T] value. Otherwise, returns the result of the [defaultValue] function. */
/**
* If [ApiResult.Success], returns the underlying [T] value. Otherwise, returns the result of the
* [defaultValue] function.
*/
public inline fun <T : Any, E : Any> ApiResult<T, E>.successOrElse(
defaultValue: (ApiResult.Failure<E>) -> T
): T =
Expand Down

0 comments on commit 46fd977

Please sign in to comment.