commit | ae2b6d5683b2dafa3c6182ef23649d0b375e3bdf | [log] [tgz] |
---|---|---|
author | Sebastiano Barezzi <seba@sebaubuntu.dev> | Mon Nov 04 20:30:51 2024 +0100 |
committer | Sebastiano Barezzi <seba@sebaubuntu.dev> | Tue Nov 05 14:00:30 2024 +0100 |
tree | 6e5653dd5a2223812c090d974dfabd8778dc1dcd | |
parent | c8dfe0e71cb7c25d24e4f7440bee5b3fd613ee55 [diff] |
Twelve: Remove unneeded `Any` bounds on RequestStatus generics Change-Id: If24f140343e2616e0cdab89433a3c5807c841e13
diff --git a/app/src/main/java/org/lineageos/twelve/datasources/SubsonicDataSource.kt b/app/src/main/java/org/lineageos/twelve/datasources/SubsonicDataSource.kt index d2d38ee..07e7bd4 100644 --- a/app/src/main/java/org/lineageos/twelve/datasources/SubsonicDataSource.kt +++ b/app/src/main/java/org/lineageos/twelve/datasources/SubsonicDataSource.kt
@@ -266,7 +266,7 @@ else -> Audio.Type.MUSIC } - private suspend fun <T : Any, O : Any> SubsonicClient.MethodResult<T>.toRequestStatus( + private suspend fun <T, O> SubsonicClient.MethodResult<T>.toRequestStatus( resultGetter: suspend T.() -> O ) = when (this) { is SubsonicClient.MethodResult.Success -> RequestStatus.Success(result.resultGetter())
diff --git a/app/src/main/java/org/lineageos/twelve/ext/LinearProgressIndicator.kt b/app/src/main/java/org/lineageos/twelve/ext/LinearProgressIndicator.kt index c533b1c..3ec0320 100644 --- a/app/src/main/java/org/lineageos/twelve/ext/LinearProgressIndicator.kt +++ b/app/src/main/java/org/lineageos/twelve/ext/LinearProgressIndicator.kt
@@ -11,7 +11,7 @@ /** * @see LinearProgressIndicator.setProgressCompat */ -fun <T : Any> LinearProgressIndicator.setProgressCompat( +fun <T> LinearProgressIndicator.setProgressCompat( status: RequestStatus<T>, animated: Boolean ) { when (status) {
diff --git a/app/src/main/java/org/lineageos/twelve/services/MediaRepositoryTree.kt b/app/src/main/java/org/lineageos/twelve/services/MediaRepositoryTree.kt index f9fc5f9..3af5a86 100644 --- a/app/src/main/java/org/lineageos/twelve/services/MediaRepositoryTree.kt +++ b/app/src/main/java/org/lineageos/twelve/services/MediaRepositoryTree.kt
@@ -261,7 +261,7 @@ * Converts a flow of [RequestStatus] to a one-shot result of [T]. * Raises an exception on error. */ - private suspend fun <T : Any> Flow<RequestStatus<T>>.toOneShotResult() = mapNotNull { + private suspend fun <T> Flow<RequestStatus<T>>.toOneShotResult() = mapNotNull { when (it) { is RequestStatus.Loading -> { null