SwiftFormat redundantSelf

This commit is contained in:
Nindi Gill 2023-11-19 19:35:57 +11:00
parent 03e6df305b
commit 13fdc52072
No known key found for this signature in database
GPG key ID: FF9A7FD590D4F4B1
5 changed files with 6 additions and 6 deletions

View file

@ -17,7 +17,7 @@ extension FileManager {
.totalFileAllocatedSizeKey
]
guard let enumerator: FileManager.DirectoryEnumerator = self.enumerator(at: url, includingPropertiesForKeys: Array(urlResourceKeys), options: [], errorHandler: { _, error -> Bool in
guard let enumerator: FileManager.DirectoryEnumerator = enumerator(at: url, includingPropertiesForKeys: Array(urlResourceKeys), options: [], errorHandler: { _, error -> Bool in
enumeratorError = error
return false
}) else {

View file

@ -10,11 +10,11 @@ import Yams
extension Sequence where Iterator.Element == [String: Any] {
func firmwaresCSVString() -> String {
"Signed,Name,Version,Build,Size,Date,Compatible\n" + self.map { $0.firmwareCSVString() }.joined()
"Signed,Name,Version,Build,Size,Date,Compatible\n" + map { $0.firmwareCSVString() }.joined()
}
func installersCSVString() -> String {
"Identifier,Name,Version,Build,Size,Date,Compatible\n" + self.map { $0.installerCSVString() }.joined()
"Identifier,Name,Version,Build,Size,Date,Compatible\n" + map { $0.installerCSVString() }.joined()
}
func jsonString() throws -> String {

View file

@ -26,7 +26,7 @@ extension String {
static let tccDatabasePath: String = "/Library/Application Support/com.apple.TCC/TCC.db"
func stringWithSubstitutions(name: String, version: String, build: String) -> String {
self.replacingOccurrences(of: "%NAME%", with: name)
replacingOccurrences(of: "%NAME%", with: name)
.replacingOccurrences(of: "%VERSION%", with: version)
.replacingOccurrences(of: "%BUILD%", with: build)
.replacingOccurrences(of: "//", with: "/")

View file

@ -16,7 +16,7 @@ extension URL {
.totalFileAllocatedSizeKey
]
let resourceValues: URLResourceValues = try self.resourceValues(forKeys: urlResourceKeys)
let resourceValues: URLResourceValues = try resourceValues(forKeys: urlResourceKeys)
guard let isRegularFile: Bool = resourceValues.isRegularFile,
isRegularFile else {

View file

@ -148,7 +148,7 @@ struct ActivityView: View {
}
taskManager.taskGroups[taskGroupIndex].tasks[taskIndex].state = .error
self.error = failure as? MistError ?? MistError.generalError(failure.localizedDescription)
error = failure as? MistError ?? MistError.generalError(failure.localizedDescription)
alertType = .error
showAlert = true