瀏覽代碼

Reorder parameters of JSON parsing method (#8321)

stevenyomi 2 年之前
父節點
當前提交
073e9f94ff
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt

+ 2 - 2
core/src/main/java/eu/kanade/tachiyomi/network/OkHttpExtensions.kt

@@ -122,12 +122,12 @@ fun OkHttpClient.newCachelessCallWithProgress(request: Request, listener: Progre
 }
 
 inline fun <reified T> Response.parseAs(): T {
-    return internalParseAs(this, typeOf<T>())
+    return internalParseAs(typeOf<T>(), this)
 }
 
 @Suppress("UNCHECKED_CAST")
 @OptIn(ExperimentalSerializationApi::class)
-fun <T> internalParseAs(response: Response, type: KType): T {
+fun <T> internalParseAs(type: KType, response: Response): T {
     val deserializer = serializer(type) as KSerializer<T>
     return response.body.source().use {
         Injekt.get<Json>().decodeFromBufferedSource(deserializer, it)