Code fluff

Replace `values()` with `entries` for enum iteration, as recommended by Kotlin for improved performance and consistency.

Also:
- Suppress unused warning in `ByteArrayAdapter`
- Improve logging in `WebpageTool` by including the exception details.
This commit is contained in:
darken
2025-06-06 06:03:41 +02:00
committed by Matthias Urhahn
parent e8481cc8cd
commit fc54e540e8
3 changed files with 8 additions and 6 deletions
@@ -6,6 +6,7 @@ import androidx.core.net.toUri
import dagger.Reusable
import dagger.hilt.android.qualifiers.ApplicationContext
import eu.darken.capod.common.debug.logging.Logging.Priority.ERROR
import eu.darken.capod.common.debug.logging.asLog
import eu.darken.capod.common.debug.logging.log
import javax.inject.Inject
@@ -21,7 +22,7 @@ class WebpageTool @Inject constructor(
try {
context.startActivity(intent)
} catch (e: Exception) {
log(ERROR) { "Failed to launch" }
log(ERROR) { "Failed to launch: ${e.asLog()}" }
}
}
@@ -5,6 +5,7 @@ import com.squareup.moshi.ToJson
import kotlin.io.encoding.Base64
import kotlin.io.encoding.ExperimentalEncodingApi
@Suppress("unused")
@OptIn(ExperimentalEncodingApi::class)
class ByteArrayAdapter {
@ToJson