Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide default values for non-frozen enums #1054

Merged
merged 2 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ extension VPNSortField {

case .serverId:
return NSSortDescriptor(key: "serverId", ascending: true)

@unknown default:
return NSSortDescriptor()
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions Library/Sources/AppUIMain/Views/Modules/DNSView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions Library/Sources/AppUIMain/Views/Modules/OnDemandView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
4 changes: 2 additions & 2 deletions Library/Sources/UILibrary/L10n/Modules/DNSModule+L10n.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
}
}
}
13 changes: 10 additions & 3 deletions Library/Sources/UILibrary/L10n/Modules/OpenVPNModule+L10n.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ extension OpenVPN.PullMask: LocalizableEntity {

case .proxy:
return Strings.Unlocalized.proxy

@unknown default:
return ""
}
}
}
Expand Down Expand Up @@ -66,7 +69,7 @@ extension OpenVPN.CompressionFraming: LocalizableEntity {
case .compress, .compressV2:
return Strings.Unlocalized.OpenVPN.compress

default:
@unknown default:
return Strings.Global.Nouns.unknown
}
}
Expand All @@ -84,7 +87,7 @@ extension OpenVPN.CompressionAlgorithm: LocalizableEntity {
case .other:
return Strings.Entities.Openvpn.CompressionAlgorithm.other

default:
@unknown default:
return Strings.Global.Nouns.unknown
}
}
Expand Down Expand Up @@ -121,6 +124,9 @@ extension OpenVPN.XORMethod: StyledLocalizableEntity {

case .obfuscate:
return V.obfuscate.rawValue

@unknown default:
return ""
}
}

Expand Down Expand Up @@ -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 ""
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions Library/Sources/UILibrary/L10n/PassepartoutKit+L10n.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ extension OnDemandModule.Policy: LocalizableEntity {

case .including:
return Strings.Entities.OnDemand.Policy.including

@unknown default:
return Strings.Entities.OnDemand.Policy.any
}
}
}
Expand Down Expand Up @@ -223,6 +226,9 @@ extension OpenVPN.Credentials.OTPMethod: StyledLocalizableEntity {

case .encode:
return V.encode

@unknown default:
return V.none
}

case .approachDescription:
Expand All @@ -236,6 +242,9 @@ extension OpenVPN.Credentials.OTPMethod: StyledLocalizableEntity {

case .encode:
return V.encode

@unknown default:
return ""
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down