Skip to content

Commit bfc6c0b

Browse files
authored
Deprecate SharedFlow.toList(dst) and toSet(dst) (#3500)
1 parent 4a13d58 commit bfc6c0b

File tree

1 file changed

+2
-2
lines changed
  • kotlinx-coroutines-core/common/src/flow/operators

1 file changed

+2
-2
lines changed

kotlinx-coroutines-core/common/src/flow/operators/Lint.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public inline fun <T> SharedFlow<T>.retryWhen(noinline predicate: suspend FlowCo
144144
level = DeprecationLevel.WARNING
145145
)
146146
@InlineOnly
147-
public suspend inline fun <T> SharedFlow<T>.toList(): List<T> =
147+
public suspend inline fun <T> SharedFlow<T>.toList(destination: MutableList<T> = ArrayList()): List<T> =
148148
(this as Flow<T>).toList()
149149

150150
/**
@@ -156,7 +156,7 @@ public suspend inline fun <T> SharedFlow<T>.toList(): List<T> =
156156
level = DeprecationLevel.WARNING
157157
)
158158
@InlineOnly
159-
public suspend inline fun <T> SharedFlow<T>.toSet(): Set<T> =
159+
public suspend inline fun <T> SharedFlow<T>.toSet(destination: MutableSet<T> = LinkedHashSet()): Set<T> =
160160
(this as Flow<T>).toSet()
161161

162162
/**

0 commit comments

Comments
 (0)