From a4b8a3e8e842a7ea9c852c6c3e98c3ac23e12235 Mon Sep 17 00:00:00 2001 From: Diogo Ortega Date: Tue, 27 Jan 2026 12:16:42 +0000 Subject: [PATCH] fix(macos): use if-expression for conditional assignment SwiftFormat conditionalAssignment rule requires using if/switch expressions (Swift 5.9+) instead of traditional conditional assignment. --- apps/macos/Sources/Clawdbot/AppState.swift | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/macos/Sources/Clawdbot/AppState.swift b/apps/macos/Sources/Clawdbot/AppState.swift index 627e5851f..689b1a61b 100644 --- a/apps/macos/Sources/Clawdbot/AppState.swift +++ b/apps/macos/Sources/Clawdbot/AppState.swift @@ -418,11 +418,10 @@ final class AppState { let trimmedUser = parsed.user?.trimmingCharacters(in: .whitespacesAndNewlines) let user = (trimmedUser?.isEmpty ?? true) ? nil : trimmedUser let port = parsed.port - let assembled: String - if let user { - assembled = port == 22 ? "\(user)@\(host)" : "\(user)@\(host):\(port)" + let assembled = if let user { + port == 22 ? "\(user)@\(host)" : "\(user)@\(host):\(port)" } else { - assembled = port == 22 ? host : "\(host):\(port)" + port == 22 ? host : "\(host):\(port)" } if assembled != self.remoteTarget { self.remoteTarget = assembled