fix(macos): use if-expression for conditional assignment

SwiftFormat conditionalAssignment rule requires using if/switch
expressions (Swift 5.9+) instead of traditional conditional assignment.
This commit is contained in:
Diogo Ortega 2026-01-27 12:16:42 +00:00
parent 755dfe72ac
commit a4b8a3e8e8

View File

@ -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