mirror of
https://github.com/mihonapp/mihon.git
synced 2025-10-24 12:08:55 +02:00
Address some build warnings
This commit is contained in:
@@ -51,6 +51,7 @@ fun OkHttpClient.Builder.rateLimitHost(
|
||||
* @param permits [Int] Number of requests allowed within a period of units.
|
||||
* @param period [Duration] The limiting duration. Defaults to 1.seconds.
|
||||
*/
|
||||
@Suppress("UNUSED")
|
||||
fun OkHttpClient.Builder.rateLimitHost(
|
||||
httpUrl: HttpUrl,
|
||||
permits: Int,
|
||||
@@ -71,5 +72,6 @@ fun OkHttpClient.Builder.rateLimitHost(
|
||||
* @param permits [Int] Number of requests allowed within a period of units.
|
||||
* @param period [Duration] The limiting duration. Defaults to 1.seconds.
|
||||
*/
|
||||
@Suppress("UNUSED")
|
||||
fun OkHttpClient.Builder.rateLimitHost(url: String, permits: Int, period: Duration = 1.seconds) =
|
||||
addInterceptor(RateLimitInterceptor(url.toHttpUrlOrNull()?.host, permits, period))
|
||||
|
||||
@@ -51,6 +51,7 @@ class InMemoryPreferenceStore(
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
override fun <T> getObject(
|
||||
key: String,
|
||||
defaultValue: T,
|
||||
@@ -59,7 +60,7 @@ class InMemoryPreferenceStore(
|
||||
): Preference<T> {
|
||||
val default = InMemoryPreference(key, null, defaultValue)
|
||||
val data: T? = preferences[key]?.get() as? T
|
||||
return if (data == null) default else InMemoryPreference<T>(key, data, defaultValue)
|
||||
return if (data == null) default else InMemoryPreference(key, data, defaultValue)
|
||||
}
|
||||
|
||||
override fun getAll(): Map<String, *> {
|
||||
|
||||
Reference in New Issue
Block a user