mirror of
https://github.com/ninxsoft/Mist.git
synced 2025-05-29 06:25:32 -04:00
SwiftFormat preferKeyPath
This commit is contained in:
parent
dac5248962
commit
c75d1007ee
7 changed files with 11 additions and 11 deletions
|
@ -16,7 +16,7 @@ class TaskManager: ObservableObject {
|
|||
var task: Task<Any, Error> = Task {}
|
||||
|
||||
var currentState: MistTaskState {
|
||||
let states: Set<MistTaskState> = Set(taskGroups.flatMap { $0.tasks }.map { $0.state })
|
||||
let states: Set<MistTaskState> = Set(taskGroups.flatMap(\.tasks).map(\.state))
|
||||
|
||||
if states.contains(.inProgress) {
|
||||
return .inProgress
|
||||
|
|
|
@ -750,7 +750,7 @@ struct Installer: Decodable, Hashable, Identifiable {
|
|||
"date": date,
|
||||
"compatible": compatible,
|
||||
"distribution": distributionURL,
|
||||
"packages": packages.map { $0.dictionary },
|
||||
"packages": packages.map(\.dictionary),
|
||||
"beta": beta
|
||||
]
|
||||
}
|
||||
|
@ -780,7 +780,7 @@ struct Installer: Decodable, Hashable, Identifiable {
|
|||
}
|
||||
|
||||
var size: UInt64 {
|
||||
UInt64(packages.map { $0.size }.reduce(0, +))
|
||||
UInt64(packages.map(\.size).reduce(0, +))
|
||||
}
|
||||
|
||||
var diskImageSize: Double {
|
||||
|
|
|
@ -36,7 +36,7 @@ struct ActivityView: View {
|
|||
private let width: CGFloat = 420
|
||||
private let height: CGFloat = 640
|
||||
private var bootableInstaller: Bool {
|
||||
taskManager.taskGroups.map { $0.section }.contains(.bootableInstaller)
|
||||
taskManager.taskGroups.map(\.section).contains(.bootableInstaller)
|
||||
}
|
||||
|
||||
private var venturaOrOlder: Bool {
|
||||
|
|
|
@ -40,7 +40,7 @@ struct ContentView: View {
|
|||
}
|
||||
|
||||
if showCompatible {
|
||||
filteredFirmwares = filteredFirmwares.filter { $0.compatible }
|
||||
filteredFirmwares = filteredFirmwares.filter(\.compatible)
|
||||
}
|
||||
|
||||
return filteredFirmwares
|
||||
|
@ -64,7 +64,7 @@ struct ContentView: View {
|
|||
}
|
||||
|
||||
if showCompatible {
|
||||
filteredInstallers = filteredInstallers.filter { $0.compatible }
|
||||
filteredInstallers = filteredInstallers.filter(\.compatible)
|
||||
}
|
||||
|
||||
return filteredInstallers
|
||||
|
|
|
@ -56,9 +56,9 @@ struct FooterView: View {
|
|||
|
||||
switch downloadType {
|
||||
case .firmware:
|
||||
dictionaries = firmwares.map { $0.dictionary }
|
||||
dictionaries = firmwares.map(\.dictionary)
|
||||
case .installer:
|
||||
dictionaries = installers.map { $0.dictionary }
|
||||
dictionaries = installers.map(\.dictionary)
|
||||
}
|
||||
|
||||
do {
|
||||
|
|
|
@ -172,7 +172,7 @@ struct RefreshView: View {
|
|||
continue
|
||||
}
|
||||
|
||||
installers.append(contentsOf: getInstallers(from: productsDictionary).filter { !installers.map { $0.id }.contains($0.id) })
|
||||
installers.append(contentsOf: getInstallers(from: productsDictionary).filter { !installers.map(\.id).contains($0.id) })
|
||||
} catch {
|
||||
continue
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ struct RefreshView: View {
|
|||
if let array: [[String: Any]] = UserDefaults.standard.array(forKey: "catalogs") as? [[String: Any]] {
|
||||
do {
|
||||
catalogs = try JSONDecoder().decode([Catalog].self, from: JSONSerialization.data(withJSONObject: array))
|
||||
let catalogTypes: [CatalogType] = catalogs.map { $0.type }
|
||||
let catalogTypes: [CatalogType] = catalogs.map(\.type)
|
||||
|
||||
for catalogType in CatalogType.allCases where !catalogTypes.contains(catalogType) {
|
||||
let catalog: Catalog = .init(type: catalogType, standard: true, customerSeed: false, developerSeed: false, publicSeed: false)
|
||||
|
|
|
@ -48,7 +48,7 @@ struct SettingsInstallersView: View {
|
|||
|
||||
do {
|
||||
var catalogs: [Catalog] = try JSONDecoder().decode([Catalog].self, from: JSONSerialization.data(withJSONObject: array))
|
||||
let catalogTypes: [CatalogType] = catalogs.map { $0.type }
|
||||
let catalogTypes: [CatalogType] = catalogs.map(\.type)
|
||||
|
||||
for catalogType in CatalogType.allCases where !catalogTypes.contains(catalogType) {
|
||||
let catalog: Catalog = .init(type: catalogType, standard: true, customerSeed: false, developerSeed: false, publicSeed: false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue