diff --git a/Meshtastic/Extensions/CoreData/ExternalNotificationConfigEntityExtension.swift b/Meshtastic/Extensions/CoreData/ExternalNotificationConfigEntityExtension.swift index 72853b432..5fa8589c7 100644 --- a/Meshtastic/Extensions/CoreData/ExternalNotificationConfigEntityExtension.swift +++ b/Meshtastic/Extensions/CoreData/ExternalNotificationConfigEntityExtension.swift @@ -23,7 +23,7 @@ extension ExternalNotificationConfigEntity { self.nagTimeout = Int32(config.nagTimeout) self.useI2SAsBuzzer = config.useI2SAsBuzzer } - + func update(with config: ModuleConfig.ExternalNotificationConfig) { enabled = config.enabled usePWM = config.usePwm diff --git a/Meshtastic/Helpers/BLEManager.swift b/Meshtastic/Helpers/BLEManager.swift index de548ba1b..b2c7b2a67 100644 --- a/Meshtastic/Helpers/BLEManager.swift +++ b/Meshtastic/Helpers/BLEManager.swift @@ -559,7 +559,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate Logger.radio.debug("📟 \(log, privacy: .public)") } } - + func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?) { if let error { @@ -600,8 +600,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate message = "DEBUG | \(message)" } handleRadioLog(radioLog: message) - } - catch { + } catch { // Ignore fail to parse as LogRecord } diff --git a/Meshtastic/Helpers/CommonRegex.swift b/Meshtastic/Helpers/CommonRegex.swift index 683f8fd7b..3cc788d18 100644 --- a/Meshtastic/Helpers/CommonRegex.swift +++ b/Meshtastic/Helpers/CommonRegex.swift @@ -8,8 +8,7 @@ import Foundation import RegexBuilder -class CommonRegex -{ +class CommonRegex { static let COORDS_REGEX = Regex { Capture { Regex { diff --git a/Meshtastic/Persistence/Persistence.swift b/Meshtastic/Persistence/Persistence.swift index 25f9a3e2d..96808c739 100644 --- a/Meshtastic/Persistence/Persistence.swift +++ b/Meshtastic/Persistence/Persistence.swift @@ -142,11 +142,11 @@ extension NSPersistentContainer { /// - Parameter backupURL: A file URL containing backup copies of all currently loaded persistent stores. /// - Throws: `CopyPersistentStoreError` in various situations. /// - Returns: Nothing. If no errors are thrown, the restore is complete. - func restorePersistentStore(from backupURL: URL) throws -> Void { + func restorePersistentStore(from backupURL: URL) throws { guard backupURL.isFileURL else { throw CopyPersistentStoreErrors.invalidSource("Backup URL must be a file URL") } - + var isDirectory: ObjCBool = false if FileManager.default.fileExists(atPath: backupURL.path, isDirectory: &isDirectory) { if !isDirectory.boolValue { @@ -185,7 +185,7 @@ extension NSPersistentContainer { /// - overwriting: If `true`, any existing copies of the persistent store will be replaced or updated. If `false`, existing copies will not be changed or remoted. When this is `false`, the destination persistent store file must not already exist. /// - Throws: `CopyPersistentStoreError` /// - Returns: Nothing. If no errors are thrown, all loaded persistent stores will be copied to the destination directory. - func copyPersistentStores(to destinationURL: URL, overwriting: Bool = false) throws -> Void { + func copyPersistentStores(to destinationURL: URL, overwriting: Bool = false) throws { guard !destinationURL.relativeString.contains("/0/") else { throw CopyPersistentStoreErrors.invalidDestination("Invalid 0 Node Id") diff --git a/Meshtastic/Persistence/UpdateCoreData.swift b/Meshtastic/Persistence/UpdateCoreData.swift index cbf63ce50..427e93ecf 100644 --- a/Meshtastic/Persistence/UpdateCoreData.swift +++ b/Meshtastic/Persistence/UpdateCoreData.swift @@ -264,7 +264,7 @@ func upsertNodeInfoPacket (packet: MeshPacket, context: NSManagedObjectContext) if fetchedNode[0].user == nil { let newUser = createUser(num: Int64(truncatingIfNeeded: packet.from), context: context) fetchedNode[0].user! = newUser - + } do { try context.save() diff --git a/Meshtastic/Views/Nodes/Helpers/Map/MapContent/MeshMapContent.swift b/Meshtastic/Views/Nodes/Helpers/Map/MapContent/MeshMapContent.swift index 2c943be99..527a896ed 100644 --- a/Meshtastic/Views/Nodes/Helpers/Map/MapContent/MeshMapContent.swift +++ b/Meshtastic/Views/Nodes/Helpers/Map/MapContent/MeshMapContent.swift @@ -76,7 +76,7 @@ struct MeshMapContent: MapContent { } } } - .onTapGesture { location in + .onTapGesture { _ in selectedPosition = (selectedPosition == position ? nil : position) } } diff --git a/Meshtastic/Views/Nodes/NodeList.swift b/Meshtastic/Views/Nodes/NodeList.swift index 238fd92a6..30b231c50 100644 --- a/Meshtastic/Views/Nodes/NodeList.swift +++ b/Meshtastic/Views/Nodes/NodeList.swift @@ -44,7 +44,7 @@ struct NodeList: View { sortDescriptors: [ NSSortDescriptor(key: "favorite", ascending: false), NSSortDescriptor(key: "lastHeard", ascending: false), - NSSortDescriptor(key: "user.longName", ascending: true), + NSSortDescriptor(key: "user.longName", ascending: true) ], animation: .spring )