Browse Source

Use `let`.

pull/3355/head
Benoit Marty 3 weeks ago
parent
commit
bc5ab0759c
  1. 4
      libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/encryption/RustIdentityResetHandle.kt

4
libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/encryption/RustIdentityResetHandle.kt

@ -30,9 +30,7 @@ object RustIdentityResetHandleFactory {
identityResetHandle: org.matrix.rustcomponents.sdk.IdentityResetHandle? identityResetHandle: org.matrix.rustcomponents.sdk.IdentityResetHandle?
): Result<IdentityResetHandle?> { ): Result<IdentityResetHandle?> {
return runCatching { return runCatching {
if (identityResetHandle == null) { identityResetHandle?.let {
null
} else {
when (val authType = identityResetHandle.authType()) { when (val authType = identityResetHandle.authType()) {
is CrossSigningResetAuthType.Oidc -> RustOidcIdentityResetHandle(identityResetHandle, authType.info.approvalUrl) is CrossSigningResetAuthType.Oidc -> RustOidcIdentityResetHandle(identityResetHandle, authType.info.approvalUrl)
// User interactive authentication (user + password) // User interactive authentication (user + password)

Loading…
Cancel
Save