mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-06-30 09:24:34 -05:00
Lint
This commit is contained in:
@@ -141,19 +141,16 @@ fun OkHttpClient.newCachelessCallWithProgress(
|
|||||||
}
|
}
|
||||||
|
|
||||||
context(_: Json)
|
context(_: Json)
|
||||||
inline fun <reified T> Response.parseAs(): T {
|
inline fun <reified T> Response.parseAs(): T = decodeFromJsonResponse(serializer(), this)
|
||||||
return decodeFromJsonResponse(serializer(), this)
|
|
||||||
}
|
|
||||||
|
|
||||||
context(json: Json)
|
context(json: Json)
|
||||||
fun <T> decodeFromJsonResponse(
|
fun <T> decodeFromJsonResponse(
|
||||||
deserializer: DeserializationStrategy<T>,
|
deserializer: DeserializationStrategy<T>,
|
||||||
response: Response,
|
response: Response,
|
||||||
): T {
|
): T =
|
||||||
return response.body.source().use {
|
response.body.source().use {
|
||||||
json.decodeFromBufferedSource(deserializer, it)
|
json.decodeFromBufferedSource(deserializer, it)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
class HttpException(
|
class HttpException(
|
||||||
val code: Int,
|
val code: Int,
|
||||||
|
|||||||
Reference in New Issue
Block a user