Provide default values for non-frozen enums (#1054)

This commit is contained in:
Davide 2025-01-12 23:12:05 +01:00 committed by GitHub
parent 9560acff3a
commit 537c5fd12c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 32 additions and 6 deletions

View File

@ -51,6 +51,9 @@ extension VPNSortField {
case .serverId:
return NSSortDescriptor(key: "serverId", ascending: true)
@unknown default:
return NSSortDescriptor()
}
}
}

View File

@ -84,6 +84,9 @@ private extension DNSView {
case .tls:
ThemeTextField(Strings.Global.Nouns.hostname, text: draft.dotHostname, placeholder: Strings.Unlocalized.Placeholders.dotHostname)
.labelsHidden()
@unknown default:
EmptyView()
}
}
}

View File

@ -112,6 +112,9 @@ private extension OnDemandView {
} else {
suffix = Strings.Modules.OnDemand.Policy.Footer.excluding
}
@unknown default:
suffix = Strings.Modules.OnDemand.Policy.Footer.any
}
return Strings.Modules.OnDemand.Policy.footer(suffix)
}

View File

@ -32,12 +32,12 @@ extension DNSProtocol: LocalizableEntity {
switch self {
case .cleartext:
return Strings.Entities.DnsProtocol.cleartext
case .https:
return Strings.Entities.DnsProtocol.https
case .tls:
return Strings.Entities.DnsProtocol.tls
@unknown default:
return ""
}
}
}

View File

@ -38,6 +38,9 @@ extension OpenVPN.PullMask: LocalizableEntity {
case .proxy:
return Strings.Unlocalized.proxy
@unknown default:
return ""
}
}
}
@ -66,7 +69,7 @@ extension OpenVPN.CompressionFraming: LocalizableEntity {
case .compress, .compressV2:
return Strings.Unlocalized.OpenVPN.compress
default:
@unknown default:
return Strings.Global.Nouns.unknown
}
}
@ -84,7 +87,7 @@ extension OpenVPN.CompressionAlgorithm: LocalizableEntity {
case .other:
return Strings.Entities.Openvpn.CompressionAlgorithm.other
default:
@unknown default:
return Strings.Global.Nouns.unknown
}
}
@ -121,6 +124,9 @@ extension OpenVPN.XORMethod: StyledLocalizableEntity {
case .obfuscate:
return V.obfuscate.rawValue
@unknown default:
return ""
}
}
@ -199,9 +205,10 @@ private extension Optional where Wrapped == OpenVPN.TLSWrap {
switch strategy {
case .auth:
return "--tls-auth"
case .crypt:
return "--tls-crypt"
@unknown default:
return ""
}
}
}

View File

@ -168,6 +168,9 @@ extension OnDemandModule.Policy: LocalizableEntity {
case .including:
return Strings.Entities.OnDemand.Policy.including
@unknown default:
return Strings.Entities.OnDemand.Policy.any
}
}
}
@ -223,6 +226,9 @@ extension OpenVPN.Credentials.OTPMethod: StyledLocalizableEntity {
case .encode:
return V.encode
@unknown default:
return V.none
}
case .approachDescription:
@ -236,6 +242,9 @@ extension OpenVPN.Credentials.OTPMethod: StyledLocalizableEntity {
case .encode:
return V.encode
@unknown default:
return ""
}
}
}

View File

@ -35,7 +35,8 @@ Tailored for Apple platforms:
### Requirements
- iOS 16+ / macOS 13+ / tvOS 17+
- Xcode 15+ (SwiftPM 5.5)
- Xcode 16+
- SwiftPM 6.0
- Git (preinstalled with Xcode Command Line Tools)
- Ruby (preinstalled with macOS)