Do some housekeeping (#347)
- Be consistent with on-demand rules - Use shortcut reduce(into:)
This commit is contained in:
parent
c80d17ceb4
commit
0f84859354
|
@ -50,7 +50,7 @@ final class IntentsManager: NSObject, ObservableObject {
|
|||
isReloadingShortcuts = true
|
||||
do {
|
||||
let vs = try await INVoiceShortcutCenter.shared.allVoiceShortcuts()
|
||||
shortcuts = vs.reduce(into: [UUID: Shortcut]()) {
|
||||
shortcuts = vs.reduce(into: [:]) {
|
||||
$0[$1.identifier] = Shortcut($1)
|
||||
}
|
||||
isReloadingShortcuts = false
|
||||
|
|
|
@ -58,11 +58,9 @@ private extension Profile.OnDemand {
|
|||
|
||||
// apply exceptions (unless .any)
|
||||
if withCustomRules && policy != .any {
|
||||
#if os(iOS)
|
||||
if Utils.hasCellularData() && withMobileNetwork {
|
||||
rules.append(cellularRule())
|
||||
}
|
||||
#endif
|
||||
if Utils.hasEthernet() && withEthernetNetwork {
|
||||
if let rule = ethernetRule() {
|
||||
rules.append(rule)
|
||||
|
|
|
@ -39,7 +39,7 @@ extension Profile.Account: StrippableContent {
|
|||
extension Profile.OnDemand: StrippableContent {
|
||||
public var stripped: Self {
|
||||
var copy = self
|
||||
copy.withSSIDs = copy.withSSIDs.reduce(into: [String: Bool]()) {
|
||||
copy.withSSIDs = copy.withSSIDs.reduce(into: [:]) {
|
||||
guard let strippedKey = $1.key.strippedNotEmpty else {
|
||||
return
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ private extension CDProfileRepository {
|
|||
context: context,
|
||||
request: request,
|
||||
mapping: {
|
||||
$0.reduce(into: [UUID: Profile]()) {
|
||||
$0.reduce(into: [:]) {
|
||||
guard let dto = $1 as? CDProfile else {
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue