Style changes

This commit is contained in:
Justin Mazzocchi 2020-12-03 14:40:33 -08:00
parent 4d7a3d690b
commit 30cedb503f
No known key found for this signature in database
GPG key ID: E223E6937AAFB01C
6 changed files with 7 additions and 7 deletions

View file

@ -50,7 +50,7 @@ public extension Identity {
var handle: String { var handle: String {
if let account = account, let host = account.url.host { if let account = account, let host = account.url.host {
return account.url.lastPathComponent + "@" + host return account.url.lastPathComponent.appending("@").appending(host)
} }
return instance?.title ?? url.host ?? url.absoluteString return instance?.title ?? url.host ?? url.absoluteString

View file

@ -50,11 +50,11 @@ extension Array where Element == Filter {
if $0.wholeWord { if $0.wholeWord {
if expression.range(of: #"^[\w]"#, options: .regularExpression) != nil { if expression.range(of: #"^[\w]"#, options: .regularExpression) != nil {
expression = #"\b"# + expression expression = #"\b"#.appending(expression)
} }
if expression.range(of: #"[\w]$"#, options: .regularExpression) != nil { if expression.range(of: #"[\w]$"#, options: .regularExpression) != nil {
expression += #"\b"# expression.append(#"\b"#)
} }
} }

View file

@ -200,7 +200,7 @@ private extension Secrets {
} }
func scopedKey(item: Item) -> String { func scopedKey(item: Item) -> String {
identityId.uuidString + "." + item.rawValue identityId.uuidString.appending(".").appending(item.rawValue)
} }
func set(_ data: SecretsStorable, forItem item: Item) throws { func set(_ data: SecretsStorable, forItem item: Item) throws {

View file

@ -27,7 +27,7 @@ public extension InstanceURLService {
if text.hasPrefix(Self.httpsPrefix), let prefixedURL = URL(string: text) { if text.hasPrefix(Self.httpsPrefix), let prefixedURL = URL(string: text) {
url = prefixedURL url = prefixedURL
} else if let unprefixedURL = URL(string: Self.httpsPrefix + text) { } else if let unprefixedURL = URL(string: Self.httpsPrefix.appending(text)) {
url = unprefixedURL url = unprefixedURL
} else { } else {
return .failure(URLError(.badURL)) return .failure(URLError(.badURL))

View file

@ -72,7 +72,7 @@ public extension StatusViewModel {
sensitive || identification.identity.preferences.readingExpandMedia == .hideAll sensitive || identification.identity.preferences.readingExpandMedia == .hideAll
} }
var accountName: String { "@" + statusService.status.displayStatus.account.acct } var accountName: String { "@".appending(statusService.status.displayStatus.account.acct) }
var avatarURL: URL { var avatarURL: URL {
if !identification.appPreferences.shouldReduceMotion, if !identification.appPreferences.shouldReduceMotion,

View file

@ -156,7 +156,7 @@ private extension Timeline {
case let .list(list): case let .list(list):
return list.title return list.title
case let .tag(tag): case let .tag(tag):
return "#" + tag return "#".appending(tag)
case .profile: case .profile:
return "" return ""
case .favorites: case .favorites: