Skip to content

Commit

Permalink
[Maintenance] removal of OptIn and Suppress
Browse files Browse the repository at this point in the history
Removal of redundant usages of `@OptIn`and `@Suppress` annotations
  • Loading branch information
GrzegorzBobryk committed Sep 26, 2024
1 parent 63986a6 commit 4586e4b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("DeprecatedCallableAddReplaceWith")

package org.koin.androidx.compose.navigation

import androidx.compose.runtime.Composable
import androidx.lifecycle.*
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelStoreOwner
import androidx.lifecycle.viewmodel.CreationExtras
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
import org.koin.androidx.viewmodel.resolveViewModel
import org.koin.compose.LocalKoinScope
import org.koin.compose.currentKoinScope
import org.koin.core.annotation.KoinInternalApi
import org.koin.core.parameter.ParametersDefinition
Expand Down Expand Up @@ -52,4 +51,4 @@ inline fun <reified T : ViewModel> koinNavViewModel(
return resolveViewModel(
T::class, viewModelStoreOwner.viewModelStore, key, extras, qualifier, scope, parameters
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("DeprecatedCallableAddReplaceWith")

package org.koin.androidx.compose.navigation

Expand All @@ -39,4 +38,4 @@ fun defaultNavExtras(viewModelStoreOwner: ViewModelStoreOwner): CreationExtras =
viewModelStoreOwner is NavBackStackEntry && viewModelStoreOwner.arguments != null -> viewModelStoreOwner.arguments?.toExtras(viewModelStoreOwner) ?: CreationExtras.Empty
viewModelStoreOwner is HasDefaultViewModelProviderFactory -> viewModelStoreOwner.defaultViewModelCreationExtras
else -> CreationExtras.Empty
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("DeprecatedCallableAddReplaceWith")

package org.koin.androidx.compose

import androidx.compose.runtime.Composable
import androidx.lifecycle.*
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelStoreOwner
import androidx.lifecycle.viewmodel.CreationExtras
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
import org.koin.androidx.viewmodel.resolveViewModel
import org.koin.compose.LocalKoinScope
import org.koin.compose.currentKoinScope
import org.koin.compose.rememberCurrentKoinScope
import org.koin.core.annotation.KoinInternalApi
Expand Down Expand Up @@ -69,4 +68,4 @@ inline fun <reified T : ViewModel> koinViewModel(
return resolveViewModel(
T::class, viewModelStoreOwner.viewModelStore, key, extras, qualifier, scope, parameters
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("DeprecatedCallableAddReplaceWith")

package org.koin.compose.viewmodel

import androidx.compose.runtime.Composable
import androidx.lifecycle.*
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelStoreOwner
import androidx.lifecycle.viewmodel.CreationExtras
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
import org.koin.compose.currentKoinScope
Expand Down Expand Up @@ -56,4 +56,4 @@ inline fun <reified T : ViewModel> koinNavViewModel(
return resolveViewModel(
T::class, viewModelStoreOwner.viewModelStore, key, extras, qualifier, scope, parameters
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("DeprecatedCallableAddReplaceWith")

package org.koin.compose.viewmodel

Expand Down Expand Up @@ -59,4 +58,4 @@ fun Bundle.toExtras(viewModelStoreOwner: ViewModelStoreOwner): CreationExtras? {
}
}.getOrNull()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress("DeprecatedCallableAddReplaceWith")

package org.koin.compose.viewmodel

import androidx.compose.runtime.Composable
import androidx.lifecycle.*
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelStoreOwner
import androidx.lifecycle.viewmodel.CreationExtras
import androidx.lifecycle.viewmodel.compose.LocalViewModelStoreOwner
import org.koin.compose.currentKoinScope
Expand Down Expand Up @@ -57,4 +57,4 @@ inline fun <reified T : ViewModel> koinViewModel(
return resolveViewModel(
T::class, viewModelStoreOwner.viewModelStore, key, extras, qualifier, scope, parameters
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Simple {
class AllFactory2(val strings: MyStringFactory, val ints: MyIntFactory)
}

@Suppress("unused")
class Errors {
class Boom {
init {
Expand Down

0 comments on commit 4586e4b

Please sign in to comment.