diff --git a/Passepartout/App/Extensions/PassepartoutProviders+Extensions.swift b/Passepartout/App/Extensions/PassepartoutProviders+Extensions.swift index 3da2c1e8..01cba642 100644 --- a/Passepartout/App/Extensions/PassepartoutProviders+Extensions.swift +++ b/Passepartout/App/Extensions/PassepartoutProviders+Extensions.swift @@ -28,15 +28,15 @@ import PassepartoutLibrary extension ProviderMetadata: Identifiable, Comparable, Hashable { public var id: String { - return name + name } public static func ==(lhs: Self, rhs: Self) -> Bool { - return lhs.name == rhs.name + lhs.name == rhs.name } public static func <(lhs: Self, rhs: Self) -> Bool { - return lhs.fullName.lowercased() < rhs.fullName.lowercased() + lhs.fullName.lowercased() < rhs.fullName.lowercased() } public func hash(into hasher: inout Hasher) { @@ -46,27 +46,27 @@ extension ProviderMetadata: Identifiable, Comparable, Hashable { extension ProviderCategory: Comparable { public static func ==(lhs: Self, rhs: Self) -> Bool { - return lhs.name.lowercased() == rhs.name.lowercased() + lhs.name.lowercased() == rhs.name.lowercased() } public static func <(lhs: Self, rhs: Self) -> Bool { - return lhs.name.lowercased() < rhs.name.lowercased() + lhs.name.lowercased() < rhs.name.lowercased() } } extension ProviderLocation: Comparable { public static func ==(lhs: Self, rhs: Self) -> Bool { - return lhs.countryCode == rhs.countryCode + lhs.countryCode == rhs.countryCode } public static func <(lhs: Self, rhs: Self) -> Bool { - return lhs.localizedCountry < rhs.localizedCountry + lhs.localizedCountry < rhs.localizedCountry } } extension ProviderServer: Comparable { public static func ==(lhs: Self, rhs: Self) -> Bool { - return lhs.id == rhs.id + lhs.id == rhs.id } // "Default" comes first @@ -86,11 +86,11 @@ extension ProviderServer: Comparable { extension ProviderServer.Preset: Comparable { public static func ==(lhs: Self, rhs: Self) -> Bool { - return lhs.name == rhs.name + lhs.name == rhs.name } public static func <(lhs: Self, rhs: Self) -> Bool { - return lhs.name < rhs.name + lhs.name < rhs.name } } diff --git a/Passepartout/AppShared/L10n/OpenVPN+L10n.swift b/Passepartout/AppShared/L10n/OpenVPN+L10n.swift index 386c5993..067e1ebe 100644 --- a/Passepartout/AppShared/L10n/OpenVPN+L10n.swift +++ b/Passepartout/AppShared/L10n/OpenVPN+L10n.swift @@ -28,13 +28,13 @@ import TunnelKitOpenVPN extension OpenVPN.Cipher { var localizedDescription: String { - return description + description } } extension OpenVPN.Digest { var localizedDescription: String { - return description + description } } diff --git a/Passepartout/AppShared/L10n/Providers+L10n.swift b/Passepartout/AppShared/L10n/Providers+L10n.swift index 05a1c3ff..faf330da 100644 --- a/Passepartout/AppShared/L10n/Providers+L10n.swift +++ b/Passepartout/AppShared/L10n/Providers+L10n.swift @@ -27,10 +27,6 @@ import Foundation import PassepartoutLibrary extension ProviderManager { -// func localizedLocation(forProfile profile: Profile) -> String? { -// return profile.providerServer(self)?.localizedDescription -// } - func localizedPreset(forProfile profile: Profile) -> String? { guard let server = profile.providerServer(self) else { return nil @@ -65,13 +61,13 @@ extension ProviderMetadata { extension ProviderLocation { var localizedCountry: String { - return countryCode.localizedAsCountryCode + countryCode.localizedAsCountryCode } } extension ProviderServer { var localizedCountry: String { - return countryCode.localizedAsCountryCode + countryCode.localizedAsCountryCode } var localizedDescription: String { @@ -83,16 +79,16 @@ extension ProviderServer { } var localizedDetails: String { - return details ?? "" + details ?? "" } var localizedDetailsWithDefault: String { - return details ?? "\(L10n.Global.Strings.default) [\(apiId)]" + details ?? "\(L10n.Global.Strings.default) [\(apiId)]" } } extension ProviderServer.Preset { var localizedDescription: String { - return name + name } } diff --git a/Passepartout/AppShared/L10n/TunnelKit+L10n.swift b/Passepartout/AppShared/L10n/TunnelKit+L10n.swift index c7a961c5..36de5d14 100644 --- a/Passepartout/AppShared/L10n/TunnelKit+L10n.swift +++ b/Passepartout/AppShared/L10n/TunnelKit+L10n.swift @@ -86,7 +86,7 @@ extension Optional where Wrapped == IPv4Settings { } var localizedDefaultGateway: String { - return self?.defaultGateway ?? L10n.Global.Strings.none + self?.defaultGateway ?? L10n.Global.Strings.none } } @@ -100,19 +100,19 @@ extension Optional where Wrapped == IPv6Settings { } var localizedDefaultGateway: String { - return self?.defaultGateway ?? L10n.Global.Strings.none + self?.defaultGateway ?? L10n.Global.Strings.none } } extension IPv4Settings.Route { var localizedDescription: String { - return "\(destination)/\(mask) -> \(gateway)" + "\(destination)/\(mask) -> \(gateway)" } } extension IPv6Settings.Route { var localizedDescription: String { - return "\(destination)/\(prefixLength) -> \(gateway)" + "\(destination)/\(prefixLength) -> \(gateway)" } } @@ -180,7 +180,7 @@ extension Error { } private func neErrorDescription(_ error: NEVPNError) -> String? { - return error.localizedDescription.capitalized + error.localizedDescription.capitalized } } diff --git a/PassepartoutLibrary/Sources/PassepartoutProviders/Extensions/PassepartoutProviders+Identifiable.swift b/PassepartoutLibrary/Sources/PassepartoutProviders/Extensions/PassepartoutProviders+Identifiable.swift index 7964a575..7a28f329 100644 --- a/PassepartoutLibrary/Sources/PassepartoutProviders/Extensions/PassepartoutProviders+Identifiable.swift +++ b/PassepartoutLibrary/Sources/PassepartoutProviders/Extensions/PassepartoutProviders+Identifiable.swift @@ -31,19 +31,19 @@ import CryptoKit extension ProviderCategory: Identifiable { public var id: String { - return "\(providerMetadata.name):\(name)" + "\(providerMetadata.name):\(name)" } } extension ProviderLocation: Identifiable { public var id: String { - return "\(providerMetadata.name):\(categoryName):\(countryCode)" + "\(providerMetadata.name):\(categoryName):\(countryCode)" } } extension ProviderServer { public var locationId: String { - return "\(providerMetadata.name):\(categoryName):\(countryCode)" + "\(providerMetadata.name):\(categoryName):\(countryCode)" } } diff --git a/PassepartoutLibrary/Sources/PassepartoutProviders/Extensions/PassepartoutProviders+Logging.swift b/PassepartoutLibrary/Sources/PassepartoutProviders/Extensions/PassepartoutProviders+Logging.swift index b1ca25d3..5738382a 100644 --- a/PassepartoutLibrary/Sources/PassepartoutProviders/Extensions/PassepartoutProviders+Logging.swift +++ b/PassepartoutLibrary/Sources/PassepartoutProviders/Extensions/PassepartoutProviders+Logging.swift @@ -28,6 +28,6 @@ import PassepartoutCore extension ProviderServer { public var logDescription: String { - return "{'\(categoryName)', \(countryCode), '\(apiId)', \(id)}" + "{'\(categoryName)', \(countryCode), '\(apiId)', \(id)}" } } diff --git a/PassepartoutLibrary/Sources/PassepartoutProviders/Extensions/ProviderName+Credentials.swift b/PassepartoutLibrary/Sources/PassepartoutProviders/Extensions/ProviderName+Credentials.swift index 4e84c0c2..543b3ef2 100644 --- a/PassepartoutLibrary/Sources/PassepartoutProviders/Extensions/ProviderName+Credentials.swift +++ b/PassepartoutLibrary/Sources/PassepartoutProviders/Extensions/ProviderName+Credentials.swift @@ -28,7 +28,7 @@ import PassepartoutCore extension ProviderName { public func requiresCredentials(forProtocol vpnProtocol: VPNProtocolType) -> Bool { - return vpnProtocol == .openVPN + vpnProtocol == .openVPN } public var credentialsPurpose: CredentialsPurpose {