Committed by
GitHub
Have EventListenable.collect return Nothing (#458)
This indicates to linters that this will never return and can mark any code after it as unreachable.
正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
| @@ -30,6 +30,6 @@ interface EventListenable<out T> { | @@ -30,6 +30,6 @@ interface EventListenable<out T> { | ||
| 30 | /** | 30 | /** |
| 31 | * @see [Flow.collect] | 31 | * @see [Flow.collect] |
| 32 | */ | 32 | */ |
| 33 | -suspend inline fun <T> EventListenable<T>.collect(crossinline action: suspend (value: T) -> Unit) { | 33 | +suspend inline fun <T> EventListenable<T>.collect(crossinline action: suspend (value: T) -> Unit): Nothing { |
| 34 | events.collect { value -> action(value) } | 34 | events.collect { value -> action(value) } |
| 35 | } | 35 | } |
-
请 注册 或 登录 后发表评论