Skip to content

Commit 89c1e81

Browse files
committed
Cleanup
1 parent c07da78 commit 89c1e81

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

firebase-remoteconfig/src/commonMain/kotlin/dev/gitlive/firebase/remoteconfig/FirebaseRemoteConfig.kt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,17 @@ expect class FirebaseRemoteConfig {
2323
suspend fun setDefaults(vararg defaults: Pair<String, Any?>)
2424
}
2525

26+
@Suppress("IMPLICIT_CAST_TO_ANY")
2627
inline operator fun <reified T> FirebaseRemoteConfig.get(key: String): T {
2728
val configValue = getValue(key)
2829
return when(T::class) {
29-
Boolean::class -> configValue.asBoolean() as T
30-
Double::class -> configValue.asDouble() as T
31-
Long::class -> configValue.asLong() as T
32-
String::class -> configValue.asString() as T
33-
FirebaseRemoteConfigValue::class -> configValue as T
30+
Boolean::class -> configValue.asBoolean()
31+
Double::class -> configValue.asDouble()
32+
Long::class -> configValue.asLong()
33+
String::class -> configValue.asString()
34+
FirebaseRemoteConfigValue::class -> configValue
3435
else -> throw IllegalArgumentException()
35-
}
36+
} as T
3637
}
3738

3839
expect open class FirebaseRemoteConfigException : FirebaseException

0 commit comments

Comments
 (0)