Skip to content

Commit

Permalink
Clean up accumulate
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Jan 16, 2025
1 parent 1096629 commit 84ea2eb
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import androidx.annotation.CallSuper
import androidx.core.content.getSystemService
import androidx.lifecycle.lifecycleScope
import arrow.core.Either
import arrow.core.flattenOrAccumulate
import arrow.core.mapOrAccumulate
import arrow.core.merge
import arrow.core.raise.either
import arrow.core.raise.ensureNotNull
Expand Down Expand Up @@ -113,8 +113,8 @@ open class TalpidVpnService : LifecycleVpnService() {
// then notify daemon to later enter blocked state.
val dnsConfigureResult =
config.dnsServers
.map { builder.addDnsServerE(it) }
.flattenOrAccumulate()
.mapOrAccumulate { builder.addDnsServerE(it).bind() }
.map { /* Ignore right */ }
.onLeft {
// Avoid creating a tunnel with no DNS servers or if all DNS servers was
// invalid, since apps then may leak DNS requests.
Expand All @@ -127,7 +127,6 @@ open class TalpidVpnService : LifecycleVpnService() {
builder.addDnsServer(FALLBACK_DUMMY_DNS_SERVER)
}
}
.map { /* Ignore right */ }

val vpnInterfaceFd =
builder
Expand Down

0 comments on commit 84ea2eb

Please sign in to comment.