From fac0d97ae5d69fd5f8247521d1011130362259da Mon Sep 17 00:00:00 2001 From: Pete Schwamb Date: Mon, 12 Oct 2026 01:19:53 -0500 Subject: [PATCH] Clean up compiler warnings that don't involve concurrency - Remove unitDidChange(to: HKUnit), left from the HKUnit API. It was empty and never called; the protocol's default now applies. - Error messages cast the error to CustomStringConvertible, which always succeeds, so the localizedDescription fallback never ran. Use String(describing:) directly; the text is unchanged. - Mark the CGMManagerUI conformance @retroactive. --- LibreLoop/Pairing/LibreLoopCGMManager+Pairing.swift | 3 +-- LibreLoopUI/LibreLoopCGMManager/LibreLoopCGMManager+UI.swift | 4 +--- LibreLoopUI/Pairing/LibreLoopPairingViewModel.swift | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/LibreLoop/Pairing/LibreLoopCGMManager+Pairing.swift b/LibreLoop/Pairing/LibreLoopCGMManager+Pairing.swift index 39c566e..0907f0a 100644 --- a/LibreLoop/Pairing/LibreLoopCGMManager+Pairing.swift +++ b/LibreLoop/Pairing/LibreLoopCGMManager+Pairing.swift @@ -1074,8 +1074,7 @@ extension LibreLoopCGMManager { } llog("reconnect: succeeded via \(outcome.path == .cached ? "cached/direct" : "full") path") } catch { - let message = (error as? CustomStringConvertible)?.description - ?? error.localizedDescription + let message = String(describing: error) llog("reconnect: attempt failed: \(message)") let backoff = await MainActor.run { () -> TimeInterval in self.consecutiveReconnectFailures += 1 diff --git a/LibreLoopUI/LibreLoopCGMManager/LibreLoopCGMManager+UI.swift b/LibreLoopUI/LibreLoopCGMManager/LibreLoopCGMManager+UI.swift index 758c5c5..3f4cea7 100644 --- a/LibreLoopUI/LibreLoopCGMManager/LibreLoopCGMManager+UI.swift +++ b/LibreLoopUI/LibreLoopCGMManager/LibreLoopCGMManager+UI.swift @@ -6,7 +6,7 @@ import LoopKit import LoopKitUI import LibreLoop -extension LibreLoopCGMManager: CGMManagerUI { +extension LibreLoopCGMManager: @retroactive CGMManagerUI { public static var onboardingImage: UIImage? { UIImage(named: "FSL3-sensor", in: Bundle(for: LibreLoopSettingsViewModel.self), compatibleWith: nil) } @@ -124,8 +124,6 @@ extension LibreLoopCGMManager: CGMManagerUI { } public func glucoseRangeCategory(for glucose: GlucoseSampleValue) -> GlucoseRangeCategory? { nil } - - public func unitDidChange(to displayGlucoseUnit: HKUnit) { } } private struct LibreLoopLifecycleProgress: DeviceLifecycleProgress { diff --git a/LibreLoopUI/Pairing/LibreLoopPairingViewModel.swift b/LibreLoopUI/Pairing/LibreLoopPairingViewModel.swift index 4b71dd8..87e6697 100644 --- a/LibreLoopUI/Pairing/LibreLoopPairingViewModel.swift +++ b/LibreLoopUI/Pairing/LibreLoopPairingViewModel.swift @@ -63,8 +63,7 @@ final class LibreLoopPairingViewModel: ObservableObject { try cgmManager.applyPairingOutcome(outcome) state = .succeeded(serial: outcome.result.sensorSerial) } catch { - state = .failed(message: (error as? CustomStringConvertible)?.description - ?? error.localizedDescription) + state = .failed(message: String(describing: error)) } }