refactor: simple closure on one line for readability

This commit is contained in:
Louis Pontoise committed 2019-10-25 20:20:53 +09:00
1 parent 2e45475a32
commit cd52663def
2 files changed
+3 -9

No files matched your search

+1 -3
View File
@@ -18,9 +18,7 @@ extension Optional {
case .some(let value):
return value
case .none:
Thread.callStackSymbols.forEach {
print($0)
}
Thread.callStackSymbols.forEach { print($0) }
throw "Optional contained nil"
}
}
+2 -6
View File
@@ -56,12 +56,8 @@ class Preferences {
try handleNoFileOrOldFile(userFile)
rawValues = try loadFromDisk(userFile)
try rawValues
.filter {
$0.key != "version"
}
.forEach {
try updateAndValidateFromString($0.key, $0.value)
}
.filter { $0.key != "version" }
.forEach { try updateAndValidateFromString($0.key, $0.value) }
} catch {
debugPrint("Error loading preferences", error)
NSApp.terminate(NSApplication.shared)