Make Announcements.asStream not suspend

This commit is contained in:
Him188 2021-07-05 15:28:13 +08:00
parent 9f1343c02e
commit 47192f3ee3
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ public interface Announcements {
/**
* 创建一个能获取该群内所有群公告列表的 [Stream]. [Stream] 被使用时才会分页下载 [OnlineAnnouncement].
*/
public suspend fun asStream(): Stream<OnlineAnnouncement>
public fun asStream(): Stream<OnlineAnnouncement>
/**
* 获取所有群公告列表, 将全部 [OnlineAnnouncement] 都下载后再返回.

View File

@ -73,7 +73,7 @@ internal class AnnouncementsImpl(
}.map { it.toAnnouncement(group) }
}
override suspend fun asStream(): Stream<OnlineAnnouncement> {
override fun asStream(): Stream<OnlineAnnouncement> {
return stream {
var i = 1
while (true) {