[kotlin][client] fix warning (#10390)

This commit is contained in:
Bruno Coelho 2021-09-14 14:20:16 +01:00 committed by GitHub
parent 27727acf52
commit 084e0930d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -370,10 +370,10 @@ import com.squareup.moshi.adapter
val call = client.newCall(request) val call = client.newCall(request)
continuation.invokeOnCancellation { call.cancel() } continuation.invokeOnCancellation { call.cancel() }
call.enqueue(object : Callback { call.enqueue(object : Callback {
override fun onFailure(c: Call, e: IOException) { override fun onFailure(call: Call, e: IOException) {
continuation.resumeWithException(e) continuation.resumeWithException(e)
} }
override fun onResponse(c: Call, response: Response) { override fun onResponse(call: Call, response: Response) {
continuation.resume(response) continuation.resume(response)
} }
}) })

View File

@ -214,10 +214,10 @@ open class ApiClient(val baseUrl: String) {
val call = client.newCall(request) val call = client.newCall(request)
continuation.invokeOnCancellation { call.cancel() } continuation.invokeOnCancellation { call.cancel() }
call.enqueue(object : Callback { call.enqueue(object : Callback {
override fun onFailure(c: Call, e: IOException) { override fun onFailure(call: Call, e: IOException) {
continuation.resumeWithException(e) continuation.resumeWithException(e)
} }
override fun onResponse(c: Call, response: Response) { override fun onResponse(call: Call, response: Response) {
continuation.resume(response) continuation.resume(response)
} }
}) })