Skip to content

Commit 2046434

Browse files
committed
fix missing overload of orEmpty
1 parent b788dec commit 2046434

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/src/commonMain/kotlin/pro/respawn/apiresult/CollectionResult.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ import kotlin.jvm.JvmName
1818
*/
1919
public inline fun <T> ApiResult<Collection<T>>.orEmpty(): Collection<T> = or(emptyList())
2020

21+
/**
22+
* Returns [emptyList] if [this]'s list is empty
23+
*/
24+
public inline fun <T> ApiResult<List<T>>.orEmpty(): List<T> = or(emptyList())
25+
2126
/**
2227
* Returns [emptyList] if [this]'s collection is empty
2328
*/

0 commit comments

Comments
 (0)