mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-01 18:04:35 -05:00
[skip ci] Formatting
This commit is contained in:
@@ -29,8 +29,8 @@ object KodeinGlobalHelper {
|
||||
fun <T : Any> instance(
|
||||
type: Class<T>,
|
||||
kodein: DI? = null,
|
||||
): T {
|
||||
return when (type) {
|
||||
): T =
|
||||
when (type) {
|
||||
AndroidFiles::class.java -> {
|
||||
val instance: AndroidFiles by (kodein ?: kodein()).instance()
|
||||
instance as T
|
||||
@@ -61,10 +61,7 @@ object KodeinGlobalHelper {
|
||||
}
|
||||
else -> throw IllegalArgumentException("Kodein instance not found")
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun <T : Any> instance(type: Class<T>): T {
|
||||
return instance(type, null)
|
||||
}
|
||||
fun <T : Any> instance(type: Class<T>): T = instance(type, null)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user