Update dependencies (#611)

This commit is contained in:
Mitchell Syer
2023-08-04 22:48:24 -04:00
committed by GitHub
parent 3675580d87
commit 689847d864
9 changed files with 35 additions and 32 deletions

View File

@@ -67,7 +67,7 @@ suspend fun Call.await(): Response {
}
continuation.resume(response) {
response.body?.closeQuietly()
response.body.closeQuietly()
}
}
@@ -120,7 +120,7 @@ fun OkHttpClient.newCallWithProgress(request: Request, listener: ProgressListene
.addNetworkInterceptor { chain ->
val originalResponse = chain.proceed(chain.request())
originalResponse.newBuilder()
.body(ProgressResponseBody(originalResponse.body!!, listener))
.body(ProgressResponseBody(originalResponse.body, listener))
.build()
}
.build()
@@ -132,7 +132,7 @@ inline fun <reified T> Response.parseAs(): T {
// Avoiding Injekt.get<Json>() due to compiler issues
val json = Injekt.getInstance<Json>(fullType<Json>().type)
this.use {
val responseBody = it.body?.string().orEmpty()
val responseBody = it.body.string()
return json.decodeFromString(responseBody)
}
}

View File

@@ -22,5 +22,5 @@ fun Element.attrOrText(css: String): String {
* @param html the body of the response. Use only if the body was read before calling this method.
*/
fun Response.asJsoup(html: String? = null): Document {
return Jsoup.parse(html ?: body!!.string(), request.url.toString())
return Jsoup.parse(html ?: body.string(), request.url.toString())
}