Skip to content

Commit

Permalink
Deprecate SharedFlow.toList(dst) and toSet(dst)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkhalanskyjb committed Oct 24, 2022
1 parent 02bf356 commit f981a1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kotlinx-coroutines-core/common/src/flow/operators/Lint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public inline fun <T> SharedFlow<T>.retryWhen(noinline predicate: suspend FlowCo
level = DeprecationLevel.WARNING
)
@InlineOnly
public suspend inline fun <T> SharedFlow<T>.toList(): List<T> =
public suspend inline fun <T> SharedFlow<T>.toList(destination: MutableList<T> = ArrayList()): List<T> =
(this as Flow<T>).toList()

/**
Expand All @@ -156,7 +156,7 @@ public suspend inline fun <T> SharedFlow<T>.toList(): List<T> =
level = DeprecationLevel.WARNING
)
@InlineOnly
public suspend inline fun <T> SharedFlow<T>.toSet(): Set<T> =
public suspend inline fun <T> SharedFlow<T>.toSet(destination: MutableSet<T> = LinkedHashSet()): Set<T> =
(this as Flow<T>).toSet()

/**
Expand Down

0 comments on commit f981a1d

Please sign in to comment.