summaryrefslogtreecommitdiffhomepage
path: root/ui
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-09-16 10:44:50 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2020-09-16 10:44:50 +0200
commitabcb51d2a680ac254bba1bc2ff223462fefde649 (patch)
tree90d865a92a0858d49fc3a8955fb8ac532f712aff /ui
parent8b9a40b3d751cf723c822e3ca317735a99f09cab (diff)
Extensions: use more idiomatic kotlin
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/src/main/java/com/wireguard/android/util/Extensions.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/src/main/java/com/wireguard/android/util/Extensions.kt b/ui/src/main/java/com/wireguard/android/util/Extensions.kt
index 9106ec77..c8892295 100644
--- a/ui/src/main/java/com/wireguard/android/util/Extensions.kt
+++ b/ui/src/main/java/com/wireguard/android/util/Extensions.kt
@@ -25,7 +25,7 @@ fun Fragment.requireTargetFragment(): Fragment {
}
val Preference.activity: SettingsActivity
- get() = if (this.context is SettingsActivity) this.context as SettingsActivity else throw IllegalStateException("Failed to resolve SettingsActivity")
+ get() = context as? SettingsActivity ?: throw IllegalStateException("Failed to resolve SettingsActivity")
val Preference.lifecycleScope: CoroutineScope
- get() = this.activity.lifecycleScope
+ get() = activity.lifecycleScope