Skip to content

Commit

Permalink
fix build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
osoykan committed Feb 17, 2025
1 parent 48e9300 commit 20e991d
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import io.ktor.client.request.*
import io.ktor.client.statement.*
import io.ktor.http.*
import io.ktor.serialization.jackson.*
import io.ktor.util.*
import io.ktor.utils.io.*
import kotlinx.coroutines.flow.*
import java.time.Duration
Expand Down Expand Up @@ -45,10 +44,10 @@ class StreamingTests :
})

@OptIn(InternalAPI::class)
suspend fun <T> HttpStatement.readJsonStream(transform: (String) -> T): Flow<T> = flow {
fun <T> HttpStatement.readJsonStream(transform: (String) -> T): Flow<T> = flow {
execute {
while (!it.content.isClosedForRead) {
val line = it.content.readUTF8Line()
while (!it.rawContent.isClosedForRead) {
val line = it.rawContent.readUTF8Line()
if (line != null) {
emit(transform(line))
}
Expand Down

0 comments on commit 20e991d

Please sign in to comment.